get_user_option_{$option} WordPress Filter Hook
The get_user_option_{$option} hook is an important tool for customizing the way your WordPress site behaves for each individual user. By using this hook, you can change how an option is retrieved for a specific user, or even create a new option altogether. This hook is especially useful for creating custom user settings, or for overriding the default behavior of WordPress options. For example, if you want to give each user the ability to choose their own theme, you could use this hook to add a new setting to the WordPress "Settings" page.
apply_filters( "get_user_option_{$option}", mixed $result , string $option , WP_User $user ) #
Filters a specific user option value.
Description
The dynamic portion of the hook name, $option
, refers to the user option name.
Parameters
Source
File: wp-includes/user.php
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |