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:
parent
9932d7973d
commit
8f1a04d2fb
|
@ -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">
|
||||||
|
|
|
@ -1171,10 +1171,12 @@ final class WP_Customize_Manager {
|
||||||
) ) );
|
) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( ! is_multisite() && current_user_can( 'install_themes' ) ) {
|
||||||
$this->add_control( new WP_Customize_New_Theme_Control( $this, 'add_theme', array(
|
$this->add_control( new WP_Customize_New_Theme_Control( $this, 'add_theme', array(
|
||||||
'section' => 'themes',
|
'section' => 'themes',
|
||||||
'settings' => 'active_theme',
|
'settings' => 'active_theme',
|
||||||
) ) );
|
) ) );
|
||||||
|
}
|
||||||
|
|
||||||
/* Site Title & Tagline */
|
/* Site Title & Tagline */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue