Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#24401 closed enhancement (fixed)

Add hook for after values saved in customizer

Reported by: dovyp Owned by: ryan
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.5
Component: Customize Keywords: has-patch
Focuses: Cc:

Description (last modified by SergeyBiryukov)

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() )

		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.
			switch_theme( $this->get_stylesheet() );

		do_action( 'customize_save', $this );

		foreach ( $this->settings as $setting ) {
		do_action( 'customize_save_after', $this );

This will allow us to use a hook for after the settings from the customizer have been saved.

Attachments (1)

24401.diff (353 bytes) - added by JustinSainton 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
5 years ago

  • Component changed from Administration to Appearance
  • Description modified (diff)
  • Severity changed from trivial to normal
  • Type changed from feature request to enhancement
  • Version changed from trunk to 3.5

#2 @markjaquith
5 years ago

  • Milestone changed from Awaiting Review to 3.6

Seems like an oversight, and I absolutely see where it would be useful. "after" hooks are a common pattern for us.

5 years ago

#3 @JustinSainton
5 years ago

  • Keywords has-patch added

#4 @ryan
5 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 24344:

Introduce customize_save_after action.

Props dovyp, JustinSainton
fixes #24401

Note: See TracTickets for help on using tickets.