Make WordPress Core

Changeset 42537


Ignore:
Timestamp:
01/22/2018 06:15:54 AM (7 years ago)
Author:
westonruter
Message:

Customize: Prevent showing SFTP theme installation notification in multisite when user cannot install themes.

Props flixos90.
See #37661, #42184.
Fixes #42674 for 4.9 branch.

Location:
branches/4.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/js/customize-controls.js

    r42188 r42537  
    25652565            // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
    25662566            function disableInstallButtons() {
    2567                 return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
     2567                return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
    25682568            }
    25692569
     
    30753075
    30763076            // Temporary since supplying SFTP credentials does not work yet. See #42184
    3077             if ( api.settings.theme._filesystemCredentialsNeeded ) {
     3077            if ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
    30783078                panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
    30793079                    message: api.l10n.themeInstallUnavailable,
     
    51335133            // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
    51345134            function disableInstallButtons() {
    5135                 return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
     5135                return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
    51365136            }
    51375137            function updateButtons() {
  • branches/4.9/src/wp-includes/class-wp-customize-manager.php

    r42172 r42537  
    46374637            ),
    46384638            'theme'    => array(
    4639                 'stylesheet' => $this->get_stylesheet(),
    4640                 'active'     => $this->is_theme_active(),
     4639                'stylesheet'  => $this->get_stylesheet(),
     4640                'active'      => $this->is_theme_active(),
     4641                '_canInstall' => current_user_can( 'install_themes' ),
    46414642            ),
    46424643            'url'      => array(
Note: See TracChangeset for help on using the changeset viewer.