WP HOOKS
filtrod 4.4.0

rest_route_data

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

Opis — z kodu źródłowego

Filters the publicly-visible data for REST API routes.

This data is exposed on indexes and can be used by clients or developers to investigate the site and find out how to use it. It acts as a form of self-documentation.

Parametry

ParametrTypOpis
$availablearray[]Route data to expose in indexes, keyed by route.
$routesarrayInternal route data as an associative array.

Wywołanie

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

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

Popularne w tej kategorii