Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Register custom query vars
<?php
/**
* Register custom query vars
*
* @param array $vars The array of available query variables
*
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/query_vars
*/
function myplugin_register_query_vars( $vars ) {
$vars[] = 'key1';
$vars[] = 'key2';
return $vars;
}
add_filter( 'query_vars', 'myplugin_register_query_vars' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.