WP HOOKS
filtrod 4.4.0

rest_post_dispatch

Args 3Plik wp-includes/rest-api/class-wp-rest-server.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the REST API response.

Allows modification of the response before returning.

Parametry

ParametrTypOpis
$result\WP_HTTP_ResponseResult to send to the client. Usually a <code>WP_REST_Response</code>.
$server\WP_REST_ServerServer instance.
$request\WP_REST_RequestRequest used to generate the response.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_post_dispatch', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii