Created
March 1, 2016 22:32
-
-
Save lstanard/fa9be3ad8b4ca898e3c1 to your computer and use it in GitHub Desktop.
Callback function and filter for adding custom query vars in WordPress
This file contains 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
// Register custom query vars | |
function cs_add_query_vars($vars) { | |
$vars[] = 'post_date'; | |
return $vars; | |
} | |
add_filter('query_vars', 'cs_add_query_vars'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment