Skip to content

Commit 3b47a42

Browse files
Check if scripts and styles are concatable
Before overriding $do_concat, verify if scripts and styles are actually concatable.
1 parent b5c28ee commit 3b47a42

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cssconcat.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ function do_items( $handles = false, $group = false ) {
8787
else
8888
$css_url_parsed['path'] = substr( $css_realpath, strlen( ABSPATH ) - 1 );
8989

90-
// Allow plugins to disable concatenation of certain stylesheets.
91-
$do_concat = apply_filters( 'css_do_concat', $do_concat, $handle );
90+
// Only allow filter for anything that is currently concat'ing
91+
// Stylesheets which are not concat'able should stay that way
92+
if ( true === $do_concat ) {
93+
$do_concat = apply_filters( 'css_do_concat', $do_concat, $handle );
94+
}
9295

9396
if ( true === $do_concat ) {
9497
$media = $obj->args;

jsconcat.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ function do_items( $handles = false, $group = false ) {
119119
$do_concat = false;
120120
}
121121

122-
// Allow plugins to disable concatenation of certain scripts.
123-
$do_concat = apply_filters( 'js_do_concat', $do_concat, $handle );
122+
// Only allow filter for anything that is currently concat'ing
123+
// Scripts which are not concat'able should stay that way
124+
if ( true === $do_concat ) {
125+
$do_concat = apply_filters( 'js_do_concat', $do_concat, $handle );
126+
}
124127

125128
if ( true === $do_concat ) {
126129
if ( !isset( $javascripts[$level] ) )

0 commit comments

Comments
 (0)