WordPress.org

Make WordPress Core

Changeset 42122


Ignore:
Timestamp:
11/07/17 04:16:11 (5 weeks ago)
Author:
westonruter
Message:

Customize: Fix logic inversion in [42113] which prevented themes from being installed in Customizer.

Also fix PHP notice related to parent themes and WordPress.org theme query results.

Props dd32, obenland, celloexpressions, westonruter, atachibana for testing.
See #42406, #37661.
Fixes #42442.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r42118 r42122  
    32033203 
    32043204            // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset. 
    3205             if ( panel.canSwitchTheme( slug ) ) { 
     3205            if ( ! panel.canSwitchTheme( slug ) ) { 
    32063206                deferred.reject({ 
    32073207                    errorCode: 'theme_switch_unavailable' 
     
    33003300            // Prevent loading a non-active theme preview when there is a drafted/scheduled changeset. 
    33013301            if ( ! panel.canSwitchTheme( themeId ) ) { 
    3302                 return deferred.reject().promise(); 
     3302                deferred.reject({ 
     3303                    errorCode: 'theme_switch_unavailable' 
     3304                }); 
     3305                return deferred.promise(); 
    33033306            } 
    33043307 
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r42109 r42122  
    54475447                $theme->screenshot   = array( $theme->screenshot_url ); 
    54485448                $theme->authorAndUri = $theme->author; 
    5449                 $theme->parent       = ( $theme->slug === $theme->template ) ? false : $theme->template; // The .org API does not seem to return the parent in a documented way; however, this check should yield a similar result in most cases. 
     5449                // The .org API can return the full parent theme details if passed the 'parent' arg, or if passed the 'template' option it'll return that in the event it's a child theme. 
     5450                if ( isset( $theme->parent ) ) { 
     5451                    $theme->parent = $theme->parent['slug']; 
     5452                } else { 
     5453                    $theme->parent = false; 
     5454                } 
    54505455                unset( $theme->slug ); 
    54515456                unset( $theme->screenshot_url ); 
Note: See TracChangeset for help on using the changeset viewer.