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.1

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

  • /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php line 1194
    			 * @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
    		$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',