From 81c6e564fcedc68cb9db6e2d37d4348727f9a38a Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 24 Oct 2016 18:16:41 +0000 Subject: [PATCH] Customize: Disable theme installation in multisite. Props celloexpressions, iamfriendly. Fixes #38370. git-svn-id: https://develop.svn.wordpress.org/trunk@38887 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-customize-manager.php | 88 ++++++++++--------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 23a65f127f..5a7cd46421 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -3026,54 +3026,56 @@ final class WP_Customize_Manager { 'priority' => 0, ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'search_themes', array( - 'title' => __( 'Search themes…' ), - 'text_before' => __( 'Browse all WordPress.org themes' ), - 'action' => 'search', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 5, - ) ) ); + if ( ! is_multisite() ) { + $this->add_section( new WP_Customize_Themes_Section( $this, 'search_themes', array( + 'title' => __( 'Search themes…' ), + 'text_before' => __( 'Browse all WordPress.org themes' ), + 'action' => 'search', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 5, + ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'featured_themes', array( - 'title' => __( 'Featured' ), - 'action' => 'featured', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 10, - ) ) ); + $this->add_section( new WP_Customize_Themes_Section( $this, 'featured_themes', array( + 'title' => __( 'Featured' ), + 'action' => 'featured', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 10, + ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'popular_themes', array( - 'title' => __( 'Popular' ), - 'action' => 'popular', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 15, - ) ) ); + $this->add_section( new WP_Customize_Themes_Section( $this, 'popular_themes', array( + 'title' => __( 'Popular' ), + 'action' => 'popular', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 15, + ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'latest_themes', array( - 'title' => __( 'Latest' ), - 'action' => 'latest', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 20, - ) ) ); + $this->add_section( new WP_Customize_Themes_Section( $this, 'latest_themes', array( + 'title' => __( 'Latest' ), + 'action' => 'latest', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 20, + ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'feature_filter_themes', array( - 'title' => __( 'Feature Filter' ), - 'action' => 'feature_filter', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 25, - ) ) ); + $this->add_section( new WP_Customize_Themes_Section( $this, 'feature_filter_themes', array( + 'title' => __( 'Feature Filter' ), + 'action' => 'feature_filter', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 25, + ) ) ); - $this->add_section( new WP_Customize_Themes_Section( $this, 'favorites_themes', array( - 'title' => __( 'Favorites' ), - 'action' => 'favorites', - 'capability' => 'install_themes', - 'panel' => 'themes', - 'priority' => 30, - ) ) ); + $this->add_section( new WP_Customize_Themes_Section( $this, 'favorites_themes', array( + 'title' => __( 'Favorites' ), + 'action' => 'favorites', + 'capability' => 'install_themes', + 'panel' => 'themes', + 'priority' => 30, + ) ) ); + } // Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience). $this->add_setting( new WP_Customize_Filter_Setting( $this, 'active_theme', array(