• I’m posting this hoping to learn a bit about filters and $wp_query.

    This thread – https://wordpress.org/support/topic/display-posts-with-future-status?replies=6 – has a filter function that works really well – it enables you to display single future posts! Yay! But I’m trying to understand why the filter works.

    This snippet in particular:

    $wp_query->post_count == 0.

    Why would the post count need to be 0? It seems to me that on a single page, the post count would be 1?

    This is clearly not an emergency, but if anyone could explain why that filter ends up showing posts with the future publish status, I’d be grateful!

Viewing 1 replies (of 1 total)
  • Thread Starter Prairieopolis

    (@prairieopolis)

    Here’s a guess:

    Is $wp_query->post_count automatically 0 when the query returns a post with the future published status? Because future posts don’t appear in the post count?

Viewing 1 replies (of 1 total)
  • The topic ‘How does the show_all_future_posts function work?’ is closed to new replies.