Remove the ability to upload custom headers in the customizer. Properly handle selecting the correct first tab, and removing the control/section if no tabs exist. see #21355.

To check if the control has any potential tabs and headers, added:
* WP_Customize_Image_Control->prepare_control()
* WP_Customize_Header_Image_Control->prepare_control()
* WP_Customize_Header_Image_Control->default_headers
* WP_Customize_Header_Image_Control->uploaded_headers



git-svn-id: http://core.svn.wordpress.org/trunk@21383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith
2012-08-01 06:45:54 +00:00
parent 50b0511449
commit 86b352faea
2 changed files with 66 additions and 12 deletions

View File

@@ -220,10 +220,6 @@
};
});
// Select a tab
this.selected = this.tabs[ panels.first().data('customizeTab') ];
this.selected.both.addClass('library-selected');
// Bind tab switch events
this.library.children('ul').on( 'click', 'li', function( event ) {
var id = $(this).data('customizeTab'),
@@ -255,6 +251,18 @@
this.tabs.uploaded.both.addClass('hidden');
}
// Select a tab
panels.each( function() {
var tab = control.tabs[ $(this).data('customizeTab') ];
// Select the first visible tab.
if ( ! tab.link.hasClass('hidden') ) {
control.selected = tab;
tab.both.addClass('library-selected');
return false;
}
});
this.dropdownInit();
},
success: function( attachment ) {