Changeset 14524 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/rest-api/class-theme-preview.php
- Timestamp:
- 09/04/2025 06:01:37 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/rest-api/class-theme-preview.php
r14523 r14524 151 151 $version = $params['version'] ?? false; 152 152 $theme_package = new WPORG_Themes_Repo_Package( $theme_data->slug, $version ); 153 $parent_package = $theme_data->template ? new WPORG_Themes_Repo_Package( $theme_data->template ) : false;154 153 $theme_blueprint = $theme_package->preview_blueprint; 154 $parent_package = false; 155 if ( isset( $theme_data->template ) && $theme_data->template !== $theme_data->slug ) { 156 $parent_package = new WPORG_Themes_Repo_Package( $theme_data->template ); 157 } 155 158 156 159 // Base blueprint. … … 214 217 'options' => [ 215 218 'blogname' => $theme_data->name . ( $version ? " $version" : '' ), 216 'blogdescription' => preg_replace( '![.].+$!', '.', $theme_data->sections['description'] ), // First sentence only.219 'blogdescription' => preg_replace( '![.].+$!', '.', $theme_data->sections['description'] ?? '' ), // First sentence only. 217 220 ] 218 221 ], … … 230 233 // Note: The following use `url` to allow setting the caption to the proper theme name. 231 234 // Install parent theme. 232 empty( $theme_data->template )? false : [235 ! $parent_package ? false : [ 233 236 'step' => 'installTheme', 234 237 'themeData' => [ … … 259 262 $theme_steps = array_filter( 260 263 $theme_steps, 261 static function( $step ) use( $invalid_steps ){264 static function( $step ) { 262 265 // Don't install assets from URLs. 263 266 if (
Note: See TracChangeset
for help on using the changeset viewer.