rest_query_var-{$key}

rest_query_var-{$key}

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('rest_query_var-{$key}') is found 2 times:

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 1194
    1190
    1191
    1192
    1193
    1194
    1195
    1196
    1197
    1198
    1199
         * @since 4.7.0
         *
         * @param string $value The query_var value.
         */
        $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    }
     
    if ( 'post' !== $this->post_type || ! isset( $query_args['ignore_sticky_posts'] ) ) {
        $query_args['ignore_sticky_posts'] = true;
    }
  • /wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php line 537
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    $query_args = array();
     
    foreach ( $prepared_args as $key => $value ) {
        /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */
        $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
    }
     
    // Map to proper WP_Query orderby param.
    if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
        $orderby_mappings = array(
            'id'            => 'ID',