Skip to content

Commit

Permalink
Rename build_query_vars_from_query_block
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 21, 2021
1 parent c39440f commit 82f150a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ function block_has_support( $block_type, $feature, $default = false ) {
*
* @return array Returns the constructed WP_Query arguments.
*/
function construct_wp_query_args( $block, $page ) {
function build_query_vars_from_query_block( $block, $page ) {
$query = array(
'post_type' => 'post',
'order' => 'DESC',
Expand Down
10 changes: 5 additions & 5 deletions tests/phpunit/tests/blocks/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public function test_build_query_vars_from_query_block() {
),
);
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = construct_wp_query_args( $block, 1 );
$query = build_query_vars_from_query_block( $block, 1 );

$this->assertSame(
$query,
Expand All @@ -458,7 +458,7 @@ public function test_build_query_vars_from_query_block_no_context() {
$parsed_blocks = parse_blocks( '<!-- wp:example {"ok":true} -->a<!-- wp:example /-->b<!-- /wp:example -->' );
$parsed_block = $parsed_blocks[0];
$block_no_context = new WP_Block( $parsed_block, array(), $this->registry );
$query = construct_wp_query_args( $block_no_context, 1 );
$query = build_query_vars_from_query_block( $block_no_context, 1 );

$this->assertSame(
$query,
Expand Down Expand Up @@ -489,7 +489,7 @@ public function test_build_query_vars_from_query_block_first_page() {
),
);
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = construct_wp_query_args( $block, 1 );
$query = build_query_vars_from_query_block( $block, 1 );

$this->assertSame(
$query,
Expand Down Expand Up @@ -522,7 +522,7 @@ public function test_build_query_vars_from_query_block_page_no_offset() {
),
);
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = construct_wp_query_args( $block, 3 );
$query = build_query_vars_from_query_block( $block, 3 );
$this->assertSame(
$query,
array(
Expand Down Expand Up @@ -554,7 +554,7 @@ public function test_build_query_vars_from_query_block_page_with_offset() {
),
);
$block = new WP_Block( $parsed_block, $context, $this->registry );
$query = construct_wp_query_args( $block, 3 );
$query = build_query_vars_from_query_block( $block, 3 );
$this->assertSame(
$query,
array(
Expand Down

0 comments on commit 82f150a

Please sign in to comment.