WP HOOKS
filtrod 5.8.0

rest_prepare_widget

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

Opis — z kodu źródłowego

Filters the REST API response for a widget.

Parametry

ParametrTypOpis
$response\WP_REST_Response | \WP_ErrorThe response object, or WP_Error object on failure.
$widgetarrayThe registered widget data.
$request\WP_REST_RequestRequest used to generate the response.

Wywołanie

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

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

Popularne w tej kategorii