Customize: Move control's fallback selection of default content template to renderContent method to align with sections and panels.

* Only use default control content template when a more specific template doesn't exist.
* Remove extraneous whitespace from being output in `WP_Customize_Control::render()` method.
* Move Custom Header template printing to `customize_controls_print_footer_scripts` action.

See #30738.


git-svn-id: https://develop.svn.wordpress.org/trunk@41935 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-10-19 03:03:19 +00:00
parent b1f20b6763
commit 1c04006909
4 changed files with 38 additions and 32 deletions
@@ -77,6 +77,8 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
return;
}
add_action( 'customize_controls_print_footer_scripts', array( $this, 'print_header_image_template' ) );
// Process default headers and uploaded headers.
$custom_image_header->process_default_headers();
$this->default_headers = $custom_image_header->get_default_header_images();
@@ -157,7 +159,6 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control {
/**
*/
public function render_content() {
$this->print_header_image_template();
$visibility = $this->get_current_image_src() ? '' : ' style="display:none" ';
$width = absint( get_theme_support( 'custom-header', 'width' ) );
$height = absint( get_theme_support( 'custom-header', 'height' ) );