Changeset 55447
- Timestamp:
- 03/01/2023 04:13:15 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r55446 r55447 1266 1266 $sticky = get_option( 'sticky_posts' ); 1267 1267 if ( 'only' === $block->context['query']['sticky'] ) { 1268 $query['post__in'] = $sticky; 1268 /* 1269 * Passing an empty array to post__in will return have_posts() as true (and all posts will be returned). 1270 * Logic should be used before hand to determine if WP_Query should be used in the event that the array 1271 * being passed to post__in is empty. 1272 * 1273 * @see https://core.trac.wordpress.org/ticket/28099 1274 */ 1275 $query['post__in'] = ! empty( $sticky ) ? $sticky : array( 0 ); 1276 $query['ignore_sticky_posts'] = 1; 1269 1277 } else { 1270 1278 $query['post__not_in'] = array_merge( $query['post__not_in'], $sticky );
Note: See TracChangeset
for help on using the changeset viewer.