[wp-trac] [WordPress Trac] #24401: Add hook for after values saved in customizer

WordPress Trac noreply at wordpress.org
Thu May 23 21:09:50 UTC 2013


#24401: Add hook for after values saved in customizer
-------------------------+------------------------------
 Reporter:  dovyp        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Appearance   |     Version:  3.5
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------------------
Changes (by SergeyBiryukov):

 * type:  feature request => enhancement
 * version:  trunk => 3.5
 * component:  Administration => Appearance
 * severity:  trivial => normal


Old description:

> 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:
> {{{
> #!div style="font-size: 80%"
> Code highlighting:
>   {{{#!php
>
> 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.

New description:

 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.

--

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24401#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list