WP HOOKS
filtrod 4.7.0

rest_prepare_post_type

Args 3Plik wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters a post type returned from the REST API.

Allows modification of the post type data right before it is returned.

Parametry

ParametrTypOpis
$response\WP_REST_ResponseThe response object.
$post_type\WP_Post_TypeThe original post type object.
$request\WP_REST_RequestRequest used to generate the response.

Wywołanie

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

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

Popularne w tej kategorii