filtrdynamicznyod 2.9.0
user_{$field}
Args 3Plik wp-includes/user.php
Opis — z kodu źródłowego
Filters the value of a user field in a standard context.
The dynamic portion of the hook name, $field, refers to the prefixed user field being filtered, such as 'user_login', 'user_email', 'first_name', etc.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$value | mixed | The user object value to sanitize. |
$user_id | int | User ID. |
$context | string | The context to filter within. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'user_{$field}', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'user_{$field}', 'twoja_funkcja', 10, 3 );
function twoja_funkcja($param_1, $param_2, $param_3) {
// Twój kod
}Popularne w tej kategorii