Changeset 54917
- Timestamp:
- 11/30/2022 06:30:57 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/wpBlock.php
r54175 r54917 605 605 ); 606 606 $block = new WP_Block( $parsed_block, $context, $this->registry ); 607 function filterQuery( $query, $block, $page ) { 608 $query['post_type'] = 'book'; 609 return $query; 610 } 611 add_filter( 'query_loop_block_query_vars', 'filterQuery', 10, 3 ); 607 608 add_filter( 609 'query_loop_block_query_vars', 610 static function( $query, $block, $page ) { 611 $query['post_type'] = 'book'; 612 return $query; 613 }, 614 10, 615 3 616 ); 617 612 618 $query = build_query_vars_from_query_block( $block, 1 ); 613 remove_filter( 'query_loop_block_query_vars', 'filterQuery' );614 619 $this->assertSame( 615 620 $query,
Note: See TracChangeset
for help on using the changeset viewer.