Skip to content

Commit caa08b4

Browse files
Copilotswissspidy
andcommitted
Fix broken themes not appearing in theme list
Modified wp_get_themes() call to include broken themes by passing array('errors' => null) parameter Co-authored-by: swissspidy <[email protected]>
1 parent dda952d commit caa08b4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

features/theme.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,18 @@ Feature: Manage WordPress themes
435435
| moina-blog | active |
436436
| moina | parent |
437437

438+
@require-wp-5.7
439+
Scenario: List broken themes (child theme without parent)
440+
Given a WP install
441+
And I run `wp theme install moina`
442+
And I run `wp theme install moina-blog`
443+
And I run `wp theme delete moina`
444+
445+
When I run `wp theme list --fields=name,status`
446+
Then STDOUT should be a table containing rows:
447+
| name | status |
448+
| moina-blog | inactive |
449+
438450
Scenario: When updating a theme --format should be the same when using --dry-run
439451
Given a WP install
440452
And I run `wp theme delete --all --force`

src/WP_CLI/ParseThemeNameInput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function get_all_themes() {
8989
$auto_updates = [];
9090
}
9191

92-
foreach ( wp_get_themes() as $key => $theme ) {
92+
foreach ( wp_get_themes( array( 'errors' => null ) ) as $key => $theme ) {
9393
$stylesheet = $theme->get_stylesheet();
9494
$update_info = ( isset( $all_update_info->response[ $stylesheet ] ) && null !== $all_update_info->response[ $theme->get_stylesheet() ] ) ? (array) $all_update_info->response[ $theme->get_stylesheet() ] : null;
9595

0 commit comments

Comments
 (0)