WP HOOKS
filtrod 4.4.0

rest_endpoints

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

Opis — z kodu źródłowego

Filters the array of available REST API endpoints.

Parametry

ParametrTypOpis
$endpointsarrayThe available endpoints. An array of matching regex patterns, each mapped to an array of callbacks for the endpoint. These take the format <code>'/path/regex' =&gt; array( $callback, $bitmask )</code> or `'/path/regex' =&gt; array( array( $callback, $bitmask ).

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'rest_endpoints', 'twoja_funkcja' );

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

Popularne w tej kategorii