Skip to content

Commit 0f0df2f

Browse files
b1ink0westonruter
andauthored
Simplify stylesheet filename logic using SCRIPT_DEBUG suffix
Co-authored-by: Weston Ruter <[email protected]>
1 parent d479361 commit 0f0df2f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/wp-content/themes/twentytwentyfive/functions.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ function twentytwentyfive_editor_style() {
4949
* @return void
5050
*/
5151
function twentytwentyfive_enqueue_styles() {
52-
$src = 'style.min.css';
53-
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || strpos( wp_get_wp_version(), '-src' ) || ! file_exists( get_parent_theme_file_path( 'style.min.css' ) ) ) {
54-
$src = 'style.css';
55-
}
52+
$suffix = SCRIPT_DEBUG ? '' : '.min';
53+
$src = 'style' . $suffix . '.css';
5654

5755
wp_enqueue_style(
5856
'twentytwentyfive-style',

src/wp-content/themes/twentytwentytwo/functions.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ function twentytwentytwo_styles() {
4646

4747
$version_string = is_string( $theme_version ) ? $theme_version : false;
4848

49-
$src = 'style.min.css';
50-
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || strpos( wp_get_wp_version(), '-src' ) || ! file_exists( get_parent_theme_file_path( 'style.min.css' ) ) ) {
51-
$src = 'style.css';
52-
}
49+
$suffix = SCRIPT_DEBUG ? '' : '.min';
50+
$src = 'style' . $suffix . '.css';
5351

5452
wp_register_style(
5553
'twentytwentytwo-style',

0 commit comments

Comments
 (0)