Skip to content

Commit 219a01b

Browse files
committed
Declare orderby_hierarchy in post controller test
1 parent 096976a commit 219a01b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3007,8 +3007,10 @@ public function get_collection_params() {
30073007
),
30083008
'default' => array(),
30093009
);
3010+
}
3011+
if ( $post_type->hierarchical ) {
30103012
$query_params['orderby_hierarchy'] = array(
3011-
'description' => 'Sort pages by hierarchy.',
3013+
'description' => __( 'Whether the post should be grouped by parent-child relationship (hierarchy).' ),
30123014
'type' => 'boolean',
30133015
'default' => false,
30143016
);

tests/phpunit/tests/rest-api/rest-posts-controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public function test_registered_query_params() {
203203
'offset',
204204
'order',
205205
'orderby',
206+
'orderby_hierarchy',
206207
'page',
207208
'per_page',
208209
'search',

0 commit comments

Comments
 (0)