option_(option) filter-hook . WP 3.0.0
Filters the value of an existing option.
The dynamic portion of the hook name, $option, refers to the option name.
Usage
add_filter( 'option_(option)', 'filter_function_name_1674', 10, 2 ); function filter_function_name_1674( $value, $option ){ // filter... return $value; }
- $value(mixed)
- Value of the option. If stored serialized, it will be unserialized prior to being returned.
- $option(string)
- Option name.
Changelog
Since 3.0.0 | Introduced. |
Since 1.5.0 | As 'option_' . $setting |
Since 4.4.0 | The $option parameter was added. |
Where the hook is called
option_(option)
wp-includes/option.php 179
return apply_filters( "option_{$option}", maybe_unserialize( $value ), $option );
wp-includes/class-wp-customize-widgets.php 2005
$value = apply_filters( 'option_' . $option_name, $value, $option_name );
Where in WP core the hook is used WordPress
wp-includes/option.php 382
add_filter( "option_{$id_base}", $multidimensional_filter );
wp-includes/option.php 280
add_filter( 'option_sidebars_widgets', array( $this, 'filter_option_sidebars_widgets_for_theme_switch' ), 1 );
wp-includes/option.php 224
add_filter( 'option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );
wp-includes/option.php 240
add_filter( 'option_ping_sites', 'privacy_ping_filter' );
wp-includes/option.php 241
add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop.
wp-includes/option.php 242
add_filter( 'option_blog_charset', '_canonical_charset' );
wp-includes/option.php 243
add_filter( 'option_home', '_config_wp_home' );
wp-includes/option.php 244
add_filter( 'option_siteurl', '_config_wp_siteurl' );
wp-includes/option.php 254
add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' );
wp-includes/option.php 255
add_filter( 'option_category_base', '_wp_filter_taxonomy_base' );
wp-includes/option.php 116
remove_filter( 'option_siteurl', '_config_wp_siteurl' );
wp-includes/option.php 117
remove_filter( 'option_home', '_config_wp_home' );
wp-includes/option.php 20
add_filter( 'option_users_can_register', 'users_can_register_signup_filter' );