Of course! I just had to set the $accepted_args
parameter of add_filter()
to 2. Like so:
add_filter('posts_join', 'my_join', 10, 2);
function my_join($join, &$query) { echo $query->is_main_query() ? 'y' : 'n'; return $join; }
Of course! I just had to set the $accepted_args
parameter of add_filter()
to 2. Like so:
add_filter('posts_join', 'my_join', 10, 2);
function my_join($join, &$query) { echo $query->is_main_query() ? 'y' : 'n'; return $join; }