Skip to content

Commit

Permalink
Plugin: Fix typo for 'ignore_sticky_posts' REST API support (#69171)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: swissspidy <[email protected]>
  • Loading branch information
3 people authored Feb 13, 2025
1 parent 9ea69df commit 322899e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.8/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function gutenberg_add_default_template_types_to_index( WP_REST_Response $respon
* @param WP_Post_Type $post_type Post type object.
* @return array
*/
function gutenberg_modify_post_collection_paramt( $query_params, WP_Post_Type $post_type ) {
function gutenberg_modify_post_collection_param( $query_params, WP_Post_Type $post_type ) {
if ( 'post' === $post_type->name && ! isset( $query_params['ignore_sticky'] ) ) {
$query_params['ignore_sticky'] = array(
'description' => __( 'Whether to ignore sticky posts or not.' ),
Expand All @@ -91,7 +91,7 @@ function gutenberg_modify_post_collection_paramt( $query_params, WP_Post_Type $p

return $query_params;
}
add_filter( 'rest_post_collection_params', 'gutenberg_modify_post_collection_paramt', 10, 2 );
add_filter( 'rest_post_collection_params', 'gutenberg_modify_post_collection_param', 10, 2 );

/**
* Modify posts query based on `ignore_sticky` parameter.
Expand Down

0 comments on commit 322899e

Please sign in to comment.