WordPress.org

Make WordPress Core

Changeset 42536


Ignore:
Timestamp:
01/22/2018 06:14:10 AM (20 months 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.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r42403 r42536  
    25682568            // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
    25692569            function disableInstallButtons() {
    2570                 return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
     2570                return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
    25712571            }
    25722572
     
    30653065
    30663066            // Temporary since supplying SFTP credentials does not work yet. See #42184
    3067             if ( api.settings.theme._filesystemCredentialsNeeded ) {
     3067            if ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
    30683068                panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
    30693069                    message: api.l10n.themeInstallUnavailable,
     
    50935093            // Temporary special function since supplying SFTP credentials does not work yet. See #42184.
    50945094            function disableInstallButtons() {
    5095                 return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
     5095                return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
    50965096            }
    50975097            function updateButtons() {
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r42343 r42536  
    47034703            ),
    47044704            'theme'                  => array(
    4705                 'stylesheet' => $this->get_stylesheet(),
    4706                 'active'     => $this->is_theme_active(),
     4705                'stylesheet'  => $this->get_stylesheet(),
     4706                'active'      => $this->is_theme_active(),
     4707                '_canInstall' => current_user_can( 'install_themes' ),
    47074708            ),
    47084709            'url'                    => array(
Note: See TracChangeset for help on using the changeset viewer.