[wp-trac] [WordPress Trac] #22177: Adding theme customizer checkbox

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 12 15:23:06 UTC 2012


#22177: Adding theme customizer checkbox
-----------------------------+--------------------------
 Reporter:  dgwyer           |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Themes
  Version:  3.4.2            |   Severity:  major
 Keywords:                   |
-----------------------------+--------------------------
 I have an issue when adding a simple checkbox to the theme customizer from
 one of my themes. I then tried to do the same in Twenty Eleven but had the
 same result.

 I think there 'may' be a conflict with the 'Display Header Text' checkbox
 which is added to the customizer from WordPress core. Reason is because
 this checkbox disappears when I try adding a checkbox of my own.

 Code I added to Twenty Eleven is as follows:

 {{{
 function theme_customizer_register_tagline_checkbox($wp_customize) {

         $wp_customize->add_section( 'my_tagline_section', array(
                 'title'          => 'My Tagline Section',
         ) );

         $wp_customize->add_setting( 'test_checkbox_setting_1624', array(
                 'default'        => null,
                 'type'           => 'option',
                 'capability'     => 'edit_theme_options' )
         );

         $wp_customize->add_control( 'display_header_text', array(
                 'settings' => 'test_checkbox_setting_1624',
                 'label'    => 'Customizer checkbox',
                 'section'  => 'my_tagline_section',
                 'type'     => 'checkbox',
         ) );
 }
 add_action( 'customize_register',
 'theme_customizer_register_tagline_checkbox' );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22177>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list