Title: pre_set_theme_mod_{$name}
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( “pre_set_theme_mod_{$name}”, mixed $value, mixed $old_value )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#wp--skip-link--target)

Filters the theme modification, or ‘theme_mod’, value on save.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#description)󠁿

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.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#parameters)󠁿

 `$value`mixed

The new value of the theme modification.

`$old_value`mixed

The current value of the theme modification.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#source)󠁿

    ```php
    $mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/theme.php#L1124)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme.php#L1124-L1124)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#related)󠁿

| Used by | Description | 
| [set_theme_mod()](https://developer.wordpress.org/reference/functions/set_theme_mod/)`wp-includes/theme.php` |

Updates theme modification value for the active theme.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/pre_set_theme_mod_name/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpre_set_theme_mod_name%2F)
before being able to contribute a note or feedback.