Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
    
The customize_save action in wp-includes/class-wp-customize-manager.php might be what you're looking for. Although I was able to save arbitrary data to the DB on that hook when clicking save in the customizer, I wasn't able to get at any of the actual fields in the customizer. I'm curious about that too. –  goto10 Jul 6 '12 at 14:24

1 Answer 1

up vote 2 down vote accepted

The settings are saved via ajax, with the action customize_save. In the wp-includes/class-wp-customize-manager.php class, the callback for this ajax method is the save 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 action

customize_save_{$setting_id}

if you wanted to trigger the action when a particular setting is saved (unfortunately there's no filter).

The save method calls the update method, which behaves different depending on whether the settings is a 'theme_mod' or 'option'. Regardless they are both saved using update_option (and so passed through the appropriate filters). The former is done so via set_theme_mod().

share|improve this answer
    
many thanks i will try this path :) –  Tribalpixel Jul 11 '12 at 14:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.