WordPress.org

Ready to get started?Download WordPress

Forums

WP_Query modification while on cron context (1 post)

  1. Stefano Lissa
    Member
    Posted 1 year ago #

    Actually it seems the WP_Query internally set the "is_home" to true when a get_posts() is called (the get_posts() function not the internal method) in the cron context.

    That is a problem since plugins that change the main query believed they are in the home rendering context.

    The WP_Query actually set the is_home to false is we are in the administration context, this is how I discovered the problem.

    I think it should be added a check on the DOING_CRON so the post extraction in a cron fired event is considered like an administrative context (or at least not the home context).

    Stefano Lissa.

Topic Closed

This topic has been closed to new replies.

About this Topic