[wp-trac] [WordPress Trac] #30988: Setting's default value doesn't apply on preview window

WordPress Trac noreply at wordpress.org
Mon Jan 12 10:37:32 UTC 2015


#30988: Setting's default value doesn't apply on preview window
----------------------------+-----------------------------
 Reporter:  Aniruddh        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  4.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Hello,

 Ever since I have upgraded my wordpress installation from 4.0 to 4.1, I am
 seeing the default value of my Cutsomizer's setting doesn't apply on
 preview window. The options table is empty and customizer's preview window
 is supposed to read default values I have mentioned. ( Just like it did in
 previous versions )


 {{{
 /* BG COLOR  */
 $wp_customize->add_setting( 'my_settings[bg_color]', array(
         'default'        => '#CCCCCC',
         'capability'     => 'edit_theme_options',
         'type'           => 'option',
 ) );
 }}}


 I read it on frontend this way:


 {{{
 $my_option = get_option( 'my_settings' );
 $my_option['bg_color'];
 }}}

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


More information about the wp-trac mailing list