filtrod 4.4.0
wp_rest_server_class
Opis — z kodu źródłowego
Filters the REST Server Class.
This filter allows you to adjust the server class used by the REST API, using a different class to handle requests.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$class_name | string | The name of the server class. Default 'WP_REST_Server'. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'wp_rest_server_class', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'wp_rest_server_class', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii