Skip to content

Commit dbdf48f

Browse files
Copilotswissspidy
andcommitted
Add clearstatcache() to refresh PHP filesystem cache
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent ca7d210 commit dbdf48f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Scaffold_Command.php

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

0 commit comments

Comments
 (0)