pre_set_theme_mod_(name) хук-фильтрWP 3.9.0

Filters the theme modification, or 'theme_mod', value on save.

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.

Использование

add_filter( 'pre_set_theme_mod_(name)', 'wp_kama_pre_set_theme_mod_name_filter', 10, 2 );

/**
 * Function for `pre_set_theme_mod_(name)` filter-hook.
 * 
 * @param mixed $value     The new value of the theme modification.
 * @param mixed $old_value The current value of the theme modification.
 *
 * @return mixed
 */
function wp_kama_pre_set_theme_mod_name_filter( $value, $old_value ){

	// filter...
	return $value;
}
$value(разное)
The new value of the theme modification.
$old_value(разное)
The current value of the theme modification.

Список изменений

С версии 3.9.0 Введена.

Где вызывается хук

set_theme_mod()
pre_set_theme_mod_(name)
wp-includes/theme.php 1111
$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );

Где используется хук в WordPress

wp-includes/blocks/site-logo.php 141
add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' );