WP HOOKS
filtrod 5.5.0

rest_prepare_block_type

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

Opis — z kodu źródłowego

Filters a block type returned from the REST API.

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

Parametry

ParametrTypOpis
$response\WP_REST_ResponseThe response object.
$block_type\WP_Block_TypeThe original block 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_block_type', 'twoja_funkcja', 10, 3 );

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

Popularne w tej kategorii