edit_user_(field) хук-фильтрWP 2.9.0

Filters a user field value in the 'edit' 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.

Использование

add_filter( 'edit_user_(field)', 'wp_kama_edit_user_field_filter', 10, 2 );

/**
 * Function for `edit_user_(field)` filter-hook.
 * 
 * @param mixed $value   Value of the prefixed user field.
 * @param int   $user_id User ID.
 *
 * @return mixed
 */
function wp_kama_edit_user_field_filter( $value, $user_id ){

	// filter...
	return $value;
}
$value(разное)
Value of the prefixed user field.
$user_id(int)
User ID.

Список изменений

С версии 2.9.0 Введена.

Где вызывается хук

sanitize_user_field()
edit_user_(field)
wp-includes/user.php 1761
$value = apply_filters( "edit_user_{$field}", $value, $user_id );

Где используется хук в WordPress

wp-includes/default-filters.php 500
add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );