Skip to content

Commit

Permalink
Revert "Merge pull request #42 from Automattic/fix/exclude-inline-js-…
Browse files Browse the repository at this point in the history
…concatenation"

This reverts commit 3562fc3, reversing
changes made to 10025c4.

Removing this so we can push out our stats changes first.
  • Loading branch information
mjangda committed Oct 29, 2018
1 parent 92f3c47 commit e9a885d
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions jsconcat.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ function do_items( $handles = false, $group = false ) {
$js_url_parsed = parse_url( $js_url );
$extra = $obj->extra;

// Check for scripts added from wp_add_inline_script()
$before_handle = $this->print_inline_script( $handle, 'before', false );
$after_handle = $this->print_inline_script( $handle, 'after', false );
if ( $before_handle ) {
$before_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $before_handle );
}
if ( $after_handle ) {
$after_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $after_handle );
}

// Don't concat by default
$do_concat = false;

Expand All @@ -89,18 +99,6 @@ function do_items( $handles = false, $group = false ) {
else
$js_url_parsed['path'] = substr( $js_realpath, strlen( ABSPATH ) - 1 );

// Check for scripts added from wp_add_inline_script()
$before_handle = $this->print_inline_script( $handle, 'before', false );
$after_handle = $this->print_inline_script( $handle, 'after', false );
if ( $before_handle ) {
$do_concat = false;
$before_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $before_handle );
}
if ( $after_handle ) {
$after_handle = sprintf( "<script type='text/javascript'>\n%s\n</script>\n", $after_handle );
$do_concat = false;
}

// Allow plugins to disable concatenation of certain scripts.
$do_concat = apply_filters( 'js_do_concat', $do_concat, $handle );

Expand Down

0 comments on commit e9a885d

Please sign in to comment.