filtrod 4.7.0
rest_prepare_comment
Opis — z kodu źródłowego
Filters a comment returned from the REST API.
Allows modification of the comment right before it is returned.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$response | \WP_REST_Response | The response object. |
$comment | \WP_Comment | The original comment 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_comment', '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_comment', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii