pre_set_theme_mod_{$name} WordPress Filter Hook

The pre_set_theme_mod_{$name} hook is called before a theme mod is set. This hook allows you to modify the value of the theme mod before it is set. This can be useful if you need to ensure that a certain value is always set, or if you need to perform some validation on the value before it is set. Note that this hook only fires when the value of the theme mod is being changed; if the theme mod already has a value and you are simply trying to retrieve it, this hook will not fire.

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

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


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.


Top ↑

Parameters

$value

(mixed)The new value of the theme modification.

$old_value

(mixed)The current value of the theme modification.


Top ↑

Source

File: wp-includes/theme.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More