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 |
---|---|
485 | * |
486 | * @since 4.4.0 |
487 | * |
488 | * @param bool $served Whether the request has already been served. |
489 | * Default false. |
490 | * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. |
491 | * @param WP_REST_Request $request Request used to generate the response. |
492 | * @param WP_REST_Server $server Server instance. |
493 | */ |
494 | $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); |
495 |
|
496 | if ( ! $served ) { |
497 | if ( 'HEAD' === $request->get_method() ) { |
498 | return null; |
499 | } |
500 |
|
501 | // Embed links inside the request. |
502 | $embed = isset( $_GET['_embed'] ) ? rest_parse_embed_param( $_GET['_embed'] ) : false; |
503 | $result = $this->response_to_data( $result, $embed ); |