Skip to content

Commit

Permalink
Do not use filters
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 26, 2024
1 parent 48b3a53 commit cd2f956
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,4 @@
add_filter( 'rest_prepare_wp_block', 'insert_hooked_blocks_into_rest_response', 10, 2 );
add_filter( 'rest_prepare_wp_navigation', 'insert_hooked_blocks_into_rest_response', 10, 2 );

// Filter the pages endpoint to consider orderby_hierarchy.
add_filter( 'rest_page_query', 'rest_page_query_hierarchical_sort_filter_by_post_in', 10, 2 );
add_filter( 'rest_prepare_page', 'rest_prepare_page_hierarchical_sort_add_levels', 10, 3 );

unset( $filter, $action );
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ static function ( $format ) {
// Force the post_type argument, since it's not a user input variable.
$args['post_type'] = $this->post_type;

$args = rest_page_query_hierarchical_sort_filter_by_post_in( $args, $request );

/**
* Filters WP_Query arguments when querying posts via the REST API.
*
Expand Down Expand Up @@ -2090,6 +2092,8 @@ public function prepare_item_for_response( $item, $request ) {
}
}

$response = rest_prepare_page_hierarchical_sort_add_levels( $response, $post, $request );

/**
* Filters the post data for a REST API response.
*
Expand Down

0 comments on commit cd2f956

Please sign in to comment.