WP HOOKS
akcjaod 4.7.0

rest_insert_comment

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

Opis — z kodu źródłowego

Fires after a comment is created or updated via the REST API.

Parametry

ParametrTypOpis
$comment\WP_CommentInserted or updated comment object.
$request\WP_REST_RequestRequest object.
$creatingboolTrue when creating a comment, false when updating.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'rest_insert_comment', 'twoja_funkcja', 10, 3 );

function twoja_funkcja($param_1, $param_2, $param_3) {
	// Twój kod
}

Popularne w tej kategorii