• Resolved shooflydesign

    (@shooflydesign)


    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)
  • Plugin Author Markus Wiesenhofer

    (@markusfroehlich)

    Hello shooflydesign,
    thank you for your topic and improvement proposal.

    I will update my plugin with the bugfix.

    Best regards
    Markus

Viewing 1 replies (of 1 total)
  • The topic ‘Bug when used with REST API’ is closed to new replies.