WP HOOKS
filtrod 4.4.0

rest_namespace_index

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

Opis — z kodu źródłowego

Filters the REST API namespace index data.

This typically is just the route data for the namespace, but you can add any data you'd like here.

Parametry

ParametrTypOpis
$response\WP_REST_ResponseResponse data.
$request\WP_REST_RequestRequest data. The namespace is passed as the 'namespace' parameter.

Wywołanie

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

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

Popularne w tej kategorii