Skip to content

Commit bb513f4

Browse files
committed
perf(Icon): skip SVG list cache via wp_get_development_mode()
1 parent a3a176a commit bb513f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎inc/Services/Icon.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ private function register_collection( string $collection_slug, array $collection
119119
}
120120

121121
/**
122-
* Returns SVG file paths for a collection directory, with transient caching in production.
122+
* Returns SVG file paths for a collection directory, with transient caching outside theme development mode.
123123
*
124124
* @param string $icons_directory Validated absolute path to a collection icons directory.
125125
*
126126
* @return list<string>
127127
*/
128128
private function get_collection_svg_files( string $icons_directory ): array {
129-
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
129+
if ( in_array( wp_get_development_mode(), [ 'theme', 'all' ], true ) ) {
130130
return $this->glob_svg_files( $icons_directory );
131131
}
132132

0 commit comments

Comments
 (0)