I am building a WordPress plugin that looks for different custom variables in the URL.
The way I am able to achieve that right now is with this code:
function add_custom_query_var( $vars){
$vars[] = "variable1";
return $vars;
}
function add_custom_query_var1( $vars1){
$vars1[] = "variable2";
return $vars1;
}
add_filter( 'query_vars', 'add_custom_query_var' );
add_filter( 'query_vars1', 'add_custom_query_var1' );
I feel like this code is redundant and was wondering if there is a better way to do this.
Thanks