Bug when used with REST API
-
There are occasions, like when called via the REST API, that this plugin isn’t triggered when it should be. Specifically, on line 516 of sticky-posts-switch.php looks like this:
$queried_object = get_queried_object();
But that can return NULL if the global wp_query is different from the one being filtered (this has been my experience in a REST API context). So I think it should be this instead:
$queried_object = $wp_query->get_queried_object();
Which will retrieve the queried object for the filtered wp_query, instead of the global one.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bug when used with REST API’ is closed to new replies.