Skip to content

Commit ca7d210

Browse files
Copilotswissspidy
andcommitted
Add wp_cache_delete to clear theme object cache
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent eb06c25 commit ca7d210

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Scaffold_Command.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,13 @@ public function child_theme( $args, $assoc_args ) {
550550
/**
551551
* Refreshes WordPress theme cache.
552552
*
553-
* Clears the theme_roots transient and rebuilds the theme directory cache.
554-
* This ensures newly created themes are recognized by WordPress before
555-
* attempting to activate or enable them.
553+
* Clears the theme_roots transient, object cache, and rebuilds the theme
554+
* directory cache. This ensures newly created themes are recognized by
555+
* WordPress before attempting to activate or enable them.
556556
*/
557557
private function refresh_theme_cache() {
558558
delete_site_transient( 'theme_roots' );
559+
wp_cache_delete( 'themes', 'themes' );
559560
search_theme_directories( true );
560561
}
561562

0 commit comments

Comments
 (0)