WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
434 | * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. |
435 | * @param WP_REST_Request $request Optional. Full details about the request. |
436 | * @return array Items query arguments. |
437 | */ |
438 | protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
439 | $query_args = array(); |
440 |
|
441 | foreach ( $prepared_args as $key => $value ) { |
442 | /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ |
443 | $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
444 | } |
445 |
|
446 | // Map to proper WP_Query orderby param. |
447 | if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) { |
448 | $orderby_mappings = array( |
449 | 'id' => 'ID', |
450 | 'include' => 'post__in', |
451 | 'slug' => 'post_name', |
452 | 'include_slugs' => 'post_name__in', |