filtrod 4.7.0
rest_prepare_status
Args 3Plik wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.phpDokumentacja WP ↗
Opis — z kodu źródłowego
Filters a post status returned from the REST API.
Allows modification of the status data right before it is returned.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$response | \WP_REST_Response | The response object. |
$status | object | The original post status object. |
$request | \WP_REST_Request | Request used to generate the response. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_prepare_status', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_prepare_status', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii