Skip to content

Commit

Permalink
REST API: Add rest_global_styles_revision_query filter
Browse files Browse the repository at this point in the history
Adds filter to modify query arguments for global styles revisions before the query is run.
  • Loading branch information
patil-vipul committed Dec 30, 2024
1 parent 2ba8433 commit f3ccc4a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public function get_items( $request ) {
}
}

/** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
$query_args = apply_filters( 'rest_global_styles_revision_query', $query_args, $request );

$revisions_query = new WP_Query();
$revisions = $revisions_query->query( $query_args );
$offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0;
Expand Down

0 comments on commit f3ccc4a

Please sign in to comment.