filtrod 4.7.0
rest_allow_anonymous_comments
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
| Parametr | Typ | Opis |
|---|---|---|
$allow_anonymous | bool | Whether to allow anonymous comments to be created. Default <code>false</code>. |
$request | \WP_REST_Request | Request 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
}
// 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