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 |
---|---|
506 | * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. |
507 | * @param WP_REST_Request $request Optional. Full details about the request. |
508 | * @return array Items query arguments. |
509 | */ |
510 | protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
511 | $query_args = array(); |
512 |
|
513 | foreach ( $prepared_args as $key => $value ) { |
514 | /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ |
515 | $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
516 | } |
517 |
|
518 | // Map to proper WP_Query orderby param. |
519 | if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) { |
520 | $orderby_mappings = array( |
521 | 'id' => 'ID', |
522 | 'include' => 'post__in', |
523 | 'slug' => 'post_name', |
524 | 'include_slugs' => 'post_name__in', |