WP HOOKS
filtrod 4.4.0

rest_index

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

Opis — z kodu źródłowego

Filters the REST API root index data.

This contains the data describing the API. This includes information about supported authentication schemes, supported namespaces, routes available on the API, and a small amount of data about the site.

Parametry

ParametrTypOpis
$response\WP_REST_ResponseResponse data.
$request\WP_REST_RequestRequest data.

Wywołanie

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

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

Popularne w tej kategorii