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 |
---|---|
457 | * |
458 | * @since 4.4.0 |
459 | * |
460 | * @param bool $served Whether the request has already been served. |
461 | * Default false. |
462 | * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. |
463 | * @param WP_REST_Request $request Request used to generate the response. |
464 | * @param WP_REST_Server $server Server instance. |
465 | */ |
466 | $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); |
467 |
|
468 | if ( ! $served ) { |
469 | if ( 'HEAD' === $request->get_method() ) { |
470 | return null; |
471 | } |
472 |
|
473 | // Embed links inside the request. |
474 | $embed = isset( $_GET['_embed'] ) ? rest_parse_embed_param( $_GET['_embed'] ) : false; |
475 | $result = $this->response_to_data( $result, $embed ); |