WordPress at a glance
filter is not described

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_5723', 10, 2 );
function filter_function_name_5723( $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.

Notes

  • Since 1.5.0 As 'option_' . $setting
  • Since 4.4.0 The $option parameter was added.

Where the hook is called

get_option()
WP_Customize_Widgets::capture_filter_pre_get_option()
wp-includes/option.php 148
return apply_filters( "option_{$option}", maybe_unserialize( $value ), $option );
wp-includes/class-wp-customize-widgets.php 1956
$value = apply_filters( 'option_' . $option_name, $value );

Where the hook is used (in WP core)

wp-includes/customize/class-wp-customize-nav-menu-setting.php 223
add_filter( 'option_nav_menu_options', array( $this, 'filter_nav_menu_options' ) );
wp-includes/class-wp-customize-widgets.php 282
add_filter( 'option_sidebars_widgets', array( $this, 'filter_option_sidebars_widgets_for_theme_switch' ), 1 );
wp-includes/ms-default-filters.php 20
add_filter( 'option_users_can_register', 'users_can_register_signup_filter' );
wp-includes/ms-default-filters.php 87
remove_filter( 'option_siteurl', '_config_wp_siteurl' );
wp-includes/ms-default-filters.php 88
remove_filter( 'option_home', '_config_wp_home' );
wp-includes/default-filters.php 227
add_filter( 'option_ping_sites', 'privacy_ping_filter' );
wp-includes/default-filters.php 228
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/default-filters.php 229
add_filter( 'option_blog_charset', '_canonical_charset' );
wp-includes/default-filters.php 230
add_filter( 'option_home', '_config_wp_home' );
wp-includes/default-filters.php 231
add_filter( 'option_siteurl', '_config_wp_siteurl' );
wp-includes/default-filters.php 240
add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' );
wp-includes/default-filters.php 241
add_filter( 'option_category_base', '_wp_filter_taxonomy_base' );
wp-includes/class-wp-customize-setting.php 368
add_filter( "option_{$id_base}", $multidimensional_filter );