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
This commit is contained in:
Dominik Schilling (ocean90) 2015-04-01 11:34:23 +00:00
parent 9932d7973d
commit 8f1a04d2fb
2 changed files with 8 additions and 9 deletions

View File

@ -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() {
?>
<div class="theme add-new-theme">
<a href="<?php echo admin_url( 'theme-install.php' ); ?>" target="_top">

View File

@ -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 */