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
340            *
341            * @since 4.7.0
342            * @since 5.7.0 Moved after the `tax_query` query arg is generated.
343            *
344            * @link https://developer.wordpress.org/reference/classes/wp_query/
345            *
346            * @param array           $args    Array of arguments for WP_Query.
347            * @param WP_REST_Request $request The REST API request.
348            */
349           $args       = apply_filters( "rest_{$this->post_type}_query", $args, $request );
350           $query_args = $this->prepare_items_query( $args, $request );
351
352           $posts_query  = new WP_Query();
353           $query_result = $posts_query->query( $query_args );
354
355           // Allow access to all password protected posts if the context is edit.
356           if ( 'edit' === $request['context'] ) {
357                add_filter( 'post_password_required', array( $this, 'check_password_required' ), 10, 2 );
358           }