[wp-trac] [WordPress Trac] #30529: Customizer: Settings with type 'option' not saved before refresh

WordPress Trac noreply at wordpress.org
Thu Nov 27 15:45:02 UTC 2014


#30529: Customizer: Settings with type 'option' not saved before refresh
----------------------------+-----------------------------
 Reporter:  jaspermdegroot  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  4.0.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Steps to reproduce:

 Customizer setting in my theme functions.php:
 {{{
 $wp_customize->add_setting( 'theme_name_options[example_option]', array(
     'default'    => 'example_default',
     'type'       => 'option',
     'transport'  => 'postMessage',
  ) );

 $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,
 'example_option_control', array(
     'label'      => __( 'Set example option', 'theme_name' ),
     'section'    => 'section_that_has_been_added',
     'settings'   => 'theme_name_options[example_option]',
 ) ) );
 }}}

 Change the example_option setting in the customizer panel (my JS live
 preview works as expected).

 Then, without "Save & Publish" first, change another setting that uses
 transport 'refresh'. For example, change the site title.

 The result is that the new value for example_option is not saved, and the
 preview shows the last saved or default value again after the refresh. The
 control for example_option will still show the new selected value though.

 If I do the same, but with the default type 'theme_mod' (still using
 transport 'postMessage'), the setting is saved before the refresh. I would
 expect that the behaviour is the same for both types.

 I tested with 4.0.1 and 4.1 beta 1.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30529>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list