Skip to content

Only concat concatable scripts and styles #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cssconcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ function do_items( $handles = false, $group = false ) {
else
$css_url_parsed['path'] = substr( $css_realpath, strlen( ABSPATH ) - 1 );

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

if ( true === $do_concat ) {
$media = $obj->args;
Expand Down
7 changes: 5 additions & 2 deletions jsconcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ function do_items( $handles = false, $group = false ) {
$do_concat = false;
}

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

if ( true === $do_concat ) {
if ( !isset( $javascripts[$level] ) )
Expand Down
Loading