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