Skip to content

Commit e295086

Browse files
author
James Amner
committed
[FIX] Frontend Rendering Quer
1 parent ad05ca8 commit e295086

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/query-include-exclude/query-include-exclude.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,16 @@ function () {
2828
);
2929
}
3030
);
31+
32+
add_filter(
33+
'query_loop_block_query_vars',
34+
function ( array $query, \WP_Block $block ): array {
35+
$block_query = $block->context['query'] ?? array();
36+
if ( ! empty( $block_query['include'] ) ) {
37+
$query['post__in'] = array_map( 'intval', $block_query['include'] );
38+
}
39+
return $query;
40+
},
41+
10,
42+
2
43+
);

0 commit comments

Comments
 (0)