Last active
June 27, 2023 03:25
-
-
Save carlodaniele/d1427af3203014943176 to your computer and use it in GitHub Desktop.
Register custom query vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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