Ticket #42442: 42442.notice.diff
File 42442.notice.diff, 1.8 KB (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-customize-manager.php
final class WP_Customize_Manager { 5434 5434 5435 5435 // Handle themes that are already installed as installed themes. 5436 5436 if ( in_array( $theme->slug, $installed_themes, true ) ) { 5437 5437 $theme->type = 'installed'; 5438 5438 } else { 5439 5439 $theme->type = $theme_action; 5440 5440 } 5441 5441 5442 5442 // Set active based on customized theme. 5443 5443 $theme->active = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme->slug ); 5444 5444 5445 5445 // Map available theme properties to installed theme properties. 5446 5446 $theme->id = $theme->slug; 5447 5447 $theme->screenshot = array( $theme->screenshot_url ); 5448 5448 $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 } 5450 5455 unset( $theme->slug ); 5451 5456 unset( $theme->screenshot_url ); 5452 5457 unset( $theme->author ); 5453 5458 } // End foreach(). 5454 5459 } // End if(). 5455 5460 5456 5461 /** 5457 5462 * Filters the theme data loaded in the customizer. 5458 5463 * 5459 5464 * This allows theme data to be loading from an external source, 5460 5465 * or modification of data loaded from `wp_prepare_themes_for_js()` 5461 5466 * or WordPress.org via `themes_api()`. 5462 5467 * 5463 5468 * @since 4.9.0 5464 5469 *