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 |
|---|---|
| 461 | * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. |
| 462 | * @param WP_REST_Request $request Optional. Full details about the request. |
| 463 | * @return array Items query arguments. |
| 464 | */ |
| 465 | protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
| 466 | $query_args = array(); |
| 467 | |
| 468 | foreach ( $prepared_args as $key => $value ) { |
| 469 | /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ |
| 470 | $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
| 471 | } |
| 472 | |
| 473 | // Map to proper WP_Query orderby param. |
| 474 | if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) { |
| 475 | $orderby_mappings = array( |
| 476 | 'id' => 'ID', |
| 477 | 'include' => 'post__in', |
| 478 | 'slug' => 'post_name', |
| 479 | 'include_slugs' => 'post_name__in', |