Opened 12 years ago
Closed 12 years ago
#24401 closed enhancement (fixed)
Add hook for after values saved in customizer
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.6 | Priority: | normal |
| Severity: | normal | Version: | 3.5 |
| Component: | Customize | Keywords: | has-patch |
| Focuses: | Cc: |
Description (last modified by )
Please add the following line to the the next release of WordPress.
do_action( 'customize_save_after', $this );
to line: 514 of class-wp-customize-manager.php
The full function should look as follows:
public function save() {
if ( ! $this->is_preview() )
die;
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce' );
// Do we have to switch themes?
if ( ! $this->is_theme_active() ) {
// Temporarily stop previewing the theme to allow switch_themes()
// to operate properly.
$this->stop_previewing_theme();
switch_theme( $this->get_stylesheet() );
$this->start_previewing_theme();
}
do_action( 'customize_save', $this );
foreach ( $this->settings as $setting ) {
$setting->save();
}
do_action( 'customize_save_after', $this );
die;
}
This will allow us to use a hook for after the settings from the customizer have been saved.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Seems like an oversight, and I absolutely see where it would be useful. "after" hooks are a common pattern for us.