get_user_option_(option)
Filters a specific user option value.
The dynamic portion of the hook name, $option, refers to the user option name.
Использование
add_filter( 'get_user_option_(option)', 'wp_kama_get_user_option_filter', 10, 3 ); /** * Function for `get_user_option_(option)` filter-hook. * * @param mixed $result Value for the user's option. * @param string $option Name of the option being retrieved. * @param WP_User $user WP_User object of the user whose option is being retrieved. * * @return mixed */ function wp_kama_get_user_option_filter( $result, $option, $user ){ // filter... return $result; }
- $result(разное)
- Value for the user's option.
- $option(строка)
- Name of the option being retrieved.
- $user(WP_User)
- WP_User object of the user whose option is being retrieved.
Список изменений
С версии 2.5.0 | Введена. |
Где вызывается хук
get_user_option_(option)
wp-includes/user.php 717
return apply_filters( "get_user_option_{$option}", $result, $option, $user );