dimanche 20 mars 2016

Wordpress Can't use query var on Static Front-Page

I've a plugin with this code:

//this function is called on plugin activation
public function socidynamo_rewrite_rule() {
 add_rewrite_endpoint( 'plugin-name', EP_ALL);
}

//this gets triggered by query_vars filter
public function plugin-name_register_query_var( $vars ) {
    $vars[] = 'plugin-name';
    return $vars;
}

It essentially adds a rewrite endpoint and a query var so pages could be loaded using http://ift.tt/1WBhoa5. It works as expected, so if echo get_query_var('plugin-name'); it returns passed value. Problem is when you set page as static front-page, so url changes to http://ift.tt/1LzRPps this breaks everything and just get a nothing found message..

Any help would be really appreciated



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire