Customizer Theme Switcher: Fix invalid HTML markup when New Theme control is added.

see #31203.
Built from https://develop.svn.wordpress.org/trunk@31950


git-svn-id: http://core.svn.wordpress.org/trunk@31929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-04-01 11:35:26 +00:00
parent 8f99fbeb8d
commit b95a8227d8
3 changed files with 9 additions and 10 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 { class WP_Customize_New_Theme_Control extends WP_Customize_Control {
/** /**
* Render the new control. * Render the control content.
* *
* @since 4.2.0 * @since 4.2.0
*/ */
public function render() { public function render_content() {
if ( is_multisite() || ! current_user_can( 'install_themes') ) {
return;
}
?> ?>
<div class="theme add-new-theme"> <div class="theme add-new-theme">
<a href="<?php echo admin_url( 'theme-install.php' ); ?>" target="_top"> <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( if ( ! is_multisite() && current_user_can( 'install_themes' ) ) {
'section' => 'themes', $this->add_control( new WP_Customize_New_Theme_Control( $this, 'add_theme', array(
'settings' => 'active_theme', 'section' => 'themes',
) ) ); 'settings' => 'active_theme',
) ) );
}
/* Site Title & Tagline */ /* Site Title & Tagline */

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-beta3-31949'; $wp_version = '4.2-beta3-31950';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.