Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_{$this->post_type}_query

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
350            *
351            * @since 4.7.0
352            * @since 5.7.0 Moved after the `tax_query` query arg is generated.
353            *
354            * @link https://developer.wordpress.org/reference/classes/wp_query/
355            *
356            * @param array           $args    Array of arguments for WP_Query.
357            * @param WP_REST_Request $request The REST API request.
358            */
359           $args       = apply_filters( "rest_{$this->post_type}_query", $args, $request );
360           $query_args = $this->prepare_items_query( $args, $request );
361
362           $posts_query  = new WP_Query();
363           $query_result = $posts_query->query( $query_args );
364
365           // Allow access to all password protected posts if the context is edit.
366           if ( 'edit' === $request['context'] ) {
367                add_filter( 'post_password_required', array( $this, 'check_password_required' ), 10, 2 );
368           }