filtrod 4.7.0
rest_preprocess_comment
Opis — z kodu źródłowego
Filters a comment added via the REST API after it is prepared for insertion into the database.
Allows modification of the comment right after it is prepared for the database.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$prepared_comment | array | The prepared comment data for <code>wp_insert_comment</code>. |
$request | \WP_REST_Request | The current request. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_preprocess_comment', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_preprocess_comment', 'twoja_funkcja', 10, 2 );
function twoja_funkcja($param_1, $param_2) {
// Twój kod
}Popularne w tej kategorii