I kept having to hunt through wp-includes/class-wp-customize-manager.php to see what the default sections in the theme customizer were registered as.
To save you the trouble, here they are:
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”3-6″ show_line_numbers=”0″]
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”8-11″ show_line_numbers=”0″]
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”18-22″ show_line_numbers=”0″]
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”24-28″ show_line_numbers=”0″]
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”30-35″ show_line_numbers=”0″]
[gist id=”e182d64246dd579b089836cbe4473808″ file=”customizer-default-sections.php” lines=”37-42″ show_line_numbers=”0″]
If you’re not sure how to add options to these default sections, give Otto’s post a read.
Thanks Devin for these snippets, very useful.
To removing one of these options (ie: Title & Tagline) from the customize back-end, just put …
… in your functions.php file.
I will try to use WP Customize and Theme options ;-)
Thanks you so much!!!! for the remove_section.
Thanks, this is a time saver! Btw, made any progress with Options Framework theme and customizer?
Yes, here’s the post:
[…] And after some digging came across the correct code to do so in a comment at: https://wptheming.com/2012/06/add-options-to-theme-customizer-default-sections/ […]
A very useful list, thanks for posting it Devin.
I wanted to rename Header Image section to Logo, surprisingly just re-adding it from functions.php, with a different name, worked fine:
// Renaming "Header Image" section to "Logo"
$wp_customize->add_section( 'header_image', array(
'title' => __( 'Logo' ),
'theme_supports' => 'custom-header',
'priority' => 60,
Still not sure if there are any downsides to doing it like this, but no errors or notices.
I notice to options that I haven’t seen before, but they don’t seem to work or i don’t understand how they work>
'description' => sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.'),
I’m a bit confused about what ‘theme_supports’ does, and the ‘description’ option doesn’t seem to do anything.. Do I need to ‘extend’ the control to get the description to work?
Thanks for this post. Once I have my theme customizer finished, I will post the code on Github.
This is nice, but how do I disable the entire customization thing completely from WordPress? Everyone shows how to set up your theme for customization, but no one how to disable the feature. If you know, please help! Thanks.
Yeah… Thanks, but this is still not answering my question. I want to disable customization completely, not just for a section or two.
[…] Theme customizer default sections, by Devin Price (very handy for the later items I’ll cover in this article) […]
Hmm… how add default section from WordPress Theme Customizer for editors? Ex. static_front_page – Static Front Page…
The static_front_page section?
Is it possible to put together ‘title_tagline’ and ‘static_front_page’ settings in the same menu?
I also got tired of hunting for the defaults, so I searched Google and found this post and bookmarked it.
Anyone has a solution for moving default WordPress control into theme’s section? I want to move the header image into “Header” section of the theme options. I tried remove and re-add the control, but it does not work.
try this adding this code to your customizer:
$wp_customize->get_section(‘section name’)->panel =’panel name’;
Thanks for your comment. Actually I’m looking for a way to move a control to another section, not section to another panel
To change default section of header image try to add following code to your customizer function:
$wp_customize->get_control( ‘header_image’)->section =’section name’;
It worked for me (section name “Images” in my case) -> http://imgur.com/YjkWAjg
Awesome. This works perfectly. Thanks a lot!
This is very useful! I found out that you can also rename the section and change its description with this method.
$wp_customize->get_section( ‘header_image’ )->title = __( ‘New Title’, ‘themename’ );
$wp_customize->get_section( ‘header_image’ )->description = __( ‘New Description’, ‘themename’ );