WP HOOKS
filtrod 4.7.0

rest_preprocess_comment

Args 2Plik wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.phpDokumentacja WP ↗

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

ParametrTypOpis
$prepared_commentarrayThe prepared comment data for <code>wp_insert_comment</code>.
$request\WP_REST_RequestThe 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
}

Popularne w tej kategorii