theme_mod_(name)
Filters the theme modification, or 'theme_mod', value.
The dynamic portion of the hook name, $name, refers to the key name of the modification array. For example, 'header_textcolor', 'header_image', and so on depending on the theme options.
Usage
add_filter( 'theme_mod_(name)', 'wp_kama_theme_mod_name_filter' ); /** * Function for `theme_mod_(name)` filter-hook. * * @param mixed $current_mod The value of the active theme modification. * * @return mixed */ function wp_kama_theme_mod_name_filter( $current_mod ){ // filter... return $current_mod; }
- $current_mod(mixed)
- The value of the active theme modification.
Changelog
Since 2.2.0 | Introduced. |
Where the hook is called
theme_mod_(name)
wp-includes/theme.php 1069
return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
wp-includes/theme.php 1082
return apply_filters( "theme_mod_{$name}", $default_value );
Where the hook is used in WordPress
wp-includes/blocks/site-logo.php 135
add_filter( 'theme_mod_custom_logo', '_override_custom_logo_theme_mod' );
wp-includes/class-wp-customize-setting.php 368
add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) );
wp-includes/class-wp-customize-setting.php 372
add_filter( "theme_mod_{$id_base}", $multidimensional_filter );