WP HOOKS
filtrod 4.7.0

rest_allow_anonymous_comments

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

Opis — z kodu źródłowego

Filters whether comments can be created via the REST API without authentication.

Enables creating comments for anonymous users.

Parametry

ParametrTypOpis
$allow_anonymousboolWhether to allow anonymous comments to be created. Default <code>false</code>.
$request\WP_REST_RequestRequest used to generate the response.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'rest_allow_anonymous_comments', 'twoja_funkcja', 10, 2 );

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

Popularne w tej kategorii