WP HOOKS
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

ParametrTypOpis
$valuemixedThe user object value to sanitize.
$user_idintUser ID.
$contextstringThe 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
}

Popularne w tej kategorii