rest_post_dispatch
rest_post_dispatch
Appears in: gutenberg.10.0.0, gutenberg.10.0.1, gutenberg.10.0.2, gutenberg.10.1.0, gutenberg.10.1.1, gutenberg.10.2.1, gutenberg.10.3.0, gutenberg.10.3.1, gutenberg.10.3.2, gutenberg.10.4.0, gutenberg.10.4.1, gutenberg.10.5.2, gutenberg.10.5.3, gutenberg.10.5.4, gutenberg.10.6.0, gutenberg.10.6.1, gutenberg.10.6.2, gutenberg.9.2.0, gutenberg.9.2.1, gutenberg.9.2.2, gutenberg.9.3.0, gutenberg.9.4.0, gutenberg.9.4.1, gutenberg.9.5.0, gutenberg.9.5.1, gutenberg.9.5.2, gutenberg.9.6.0, gutenberg.9.6.1, gutenberg.9.6.2, gutenberg.9.7.0, gutenberg.9.7.1, gutenberg.9.7.2, gutenberg.9.7.3, gutenberg.9.7.4, gutenberg.9.8.0, gutenberg.9.8.1, gutenberg.9.8.2, gutenberg.9.8.3, gutenberg.9.8.4, gutenberg.9.9.0, gutenberg.9.9.1, gutenberg.9.9.2, gutenberg.9.9.3, wordpress-4.4, wordpress-4.8, wordpress-4.9, wordpress-4.9.4, wordpress-4.9.5, wordpress-4.9.6, wordpress-4.9.7, wordpress-4.9.8, wordpress-5.0, wordpress-5.0.1, wordpress-5.0.2, wordpress-5.0.3, wordpress-5.1, wordpress-5.1.1, wordpress-5.2, wordpress-5.2.1, wordpress-5.2.2, wordpress-5.2.3, wordpress-5.3, wordpress-5.3.1, wordpress-5.3.2, wordpress-5.4, wordpress-5.4.1, wordpress-5.4.2, wordpress-5.5, wordpress-5.5.1, wordpress-5.5.2, wordpress-5.5.3, wordpress-5.6, wordpress-5.6.1, wordpress-5.6.2, wordpress-5.7, wordpress-5.7.1, wordpress-5.7.2, wordpress-5.8, wordpress-5.8.1, wordpress-5.8.2, wordpress-5.8.3, wordpress-5.9, wordpress-5.9.1, wordpress-5.9.2, wordpress-5.9.3, wordpress-6.0, wordpress-6.0.1, wordpress-6.0.2, wordpress-6.0.3, wordpress-6.1, wordpress-6.1.1, wordpress-6.2, wordpress-6.2.1, wordpress-6.2.2, wordpress-6.3, wordpress-6.3.1, wordpress-6.3.2, wordpress-6.4, wordpress-6.4.1, wordpress-6.4.2, wordpress-6.4.3, wordpress-6.5, wordpress-6.5.2, wordpress-6.5.3, wordpress-6.5.4, wordpress-6.5.5, wordpress-6.6, wordpress-6.6.1, wordpress-6.6.2, wordpress-6.7, wordpress-6.7.1, wordpress-6.7.2
Hook Type: filter
See hook in action
Displaying hooks found in version: wordpress-6.7.2apply_filters('rest_post_dispatch') is found 4 times:
- /wp-includes/rest-api/class-wp-rest-server.php line 462458459460461462463464465466467468
* @param WP_HTTP_Response
$result
Result to send to the client. Usually a `WP_REST_Response`.
* @param WP_REST_Server
$server
Server instance.
* @param WP_REST_Request
$request
Request used to generate the response.
*/
$result
= apply_filters(
'rest_post_dispatch'
, rest_ensure_response(
$result
),
$this
,
$request
);
// Wrap the response in an envelope if asked for.
if
( isset(
$_GET
[
'_envelope'
] ) ) {
$embed
= isset(
$_GET
[
'_embed'
] ) ? rest_parse_embed_param(
$_GET
[
'_embed'
] ) : false;
$result
=
$this
->envelope_response(
$result
,
$embed
);
}
- /wp-includes/rest-api/class-wp-rest-server.php line 823820821822823824825826827828829
$response
=
$this
->dispatch(
$request
);
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
$response
= apply_filters(
'rest_post_dispatch'
, rest_ensure_response(
$response
),
$this
,
$request
);
$this
->embed_cache[
$item
[
'href'
] ] =
$this
->response_to_data(
$response
, false );
}
$embeds
[] =
$this
->embed_cache[
$item
[
'href'
] ];
}
- /wp-includes/rest-api/class-wp-rest-server.php line 185718531854185518561857185818591860186118621863
}
}
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
$result
= apply_filters(
'rest_post_dispatch'
, rest_ensure_response(
$result
),
$this
,
$single_request
);
$responses
[] =
$this
->envelope_response(
$result
, false )->get_data();
}
return
new
WP_REST_Response(
array
(
'responses'
=>
$responses
), WP_Http::MULTI_STATUS );
}
- /wp-includes/rest-api.php line 296129572958295929602961296229632964296529662967
$response
= rest_do_request(
$request
);
if
( 200 ===
$response
->status ) {
$server
= rest_get_server();
/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
$response
= apply_filters(
'rest_post_dispatch'
, rest_ensure_response(
$response
),
$server
,
$request
);
$embed
=
$request
->has_param(
'_embed'
) ? rest_parse_embed_param(
$request
[
'_embed'
] ) : false;
$data
= (
array
)
$server
->response_to_data(
$response
,
$embed
);
if
(
'OPTIONS'
===
$method
) {
$memo
[
$method
][
$path
] =
array
(
'body'
=>
$data
,