From 8f1a04d2fb15d9382393645cf832ed3ce054254d Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 1 Apr 2015 11:34:23 +0000 Subject: [PATCH] Customizer Theme Switcher: Fix invalid HTML markup when New Theme control is added. see #31203. git-svn-id: https://develop.svn.wordpress.org/trunk@31950 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-control.php | 7 ++----- src/wp-includes/class-wp-customize-manager.php | 10 ++++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index 46ce984586..de377d8fe2 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -1243,14 +1243,11 @@ class WP_Customize_Theme_Control extends WP_Customize_Control { class WP_Customize_New_Theme_Control extends WP_Customize_Control { /** - * Render the new control. + * Render the control content. * * @since 4.2.0 */ - public function render() { - if ( is_multisite() || ! current_user_can( 'install_themes') ) { - return; - } + public function render_content() { ?>
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 0f449fc87a..4be5622382 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -1171,10 +1171,12 @@ final class WP_Customize_Manager { ) ) ); } - $this->add_control( new WP_Customize_New_Theme_Control( $this, 'add_theme', array( - 'section' => 'themes', - 'settings' => 'active_theme', - ) ) ); + if ( ! is_multisite() && current_user_can( 'install_themes' ) ) { + $this->add_control( new WP_Customize_New_Theme_Control( $this, 'add_theme', array( + 'section' => 'themes', + 'settings' => 'active_theme', + ) ) ); + } /* Site Title & Tagline */