Skip to content

Commit

Permalink
Revert "[Block Library - Query Loop]: Fix display of non sticky posts…
Browse files Browse the repository at this point in the history
… when `sticky` is set to `only` (#35329)" (#35401)

This reverts commit 770964c.
  • Loading branch information
ntsekouras authored Oct 6, 2021
1 parent 35b6126 commit 2ecd5a0
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/block-library/src/post-template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,6 @@ function render_block_core_post_template( $attributes, $content, $block ) {
}
}

/**
* Passing an empty array to post__in will return have_posts() as true (and all posts will be returned).
* Logic should be used before hand to determine if WP_Query should be used in the event that the array
* being passed to post__in is empty.
*
* @see https://core.trac.wordpress.org/ticket/28099
*/
if ( isset( $query_args['post__in'] ) && count( $query_args['post__in'] ) === 0 ) {
return '';
}

$query = new WP_Query( $query_args );

if ( ! $query->have_posts() ) {
Expand Down

0 comments on commit 2ecd5a0

Please sign in to comment.