Hello in the init
action, I would like to add a filter to a fairly large function to modify variables in the $vars
array, for example the Wordpress post ID.
That is to say:
add_action( 'init',function(){
//code
add_filter( 'query_vars',function($vars){
$vars[] = array('ID' => $myid);
return $vars;
});
});
Is this possible?
EDIT: I am doing A/B/C tests of pages and with the same url I want to show a page with another ID, (i.e. edit the ID of the current post to display the complete content of another post).
init
, but this approach to your problem is completely wrong. Your comment below "I am doing A/B/C tests of pages and with the same url I want to show a page or another ID" should be your question.