i’m looking for the action/hook called when saving theme customs colors in the new admin interface?
i need to call a custom function to save a set of php generated images.
if anyone have clues… 🙂
thanks
i’m looking for the action/hook called when saving theme customs colors in the new admin interface?
i need to call a custom function to save a set of php generated images.
if anyone have clues… 🙂
thanks
You must be logged in to post a comment.
The settings are saved via ajax, with the action
customize_save
. In thewp-includes/class-wp-customize-manager.php
class, the callback for this ajax method is thesave
method (see source)This triggers the
customize_save
action, prior to updating each of the settings.Each setting is actually an instance of the class
WP_Customize_Setting
and saving the setting triggers the actionif you wanted to trigger the action when a particular setting is saved (unfortunately there’s no filter).
The
save
method calls theupdate
method, which behaves different depending on whether the settings is a ‘theme_mod’ or ‘option’. Regardless they are both saved usingupdate_option
(and so passed through the appropriate filters). The former is done so viaset_theme_mod()
.