Skip to content
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

Duplicate ID defined in some instances #67

Open
trepmal opened this issue Jan 14, 2022 · 0 comments
Open

Duplicate ID defined in some instances #67

trepmal opened this issue Jan 14, 2022 · 0 comments

Comments

@trepmal
Copy link
Contributor

trepmal commented Jan 14, 2022

This ID:

echo apply_filters( 'ngx_http_concat_style_loader_tag', "<link rel='stylesheet' id='$media-css-$idx' href='$href' type='text/css' media='$media' />\n", $handles, $href, $media );

the do_items() function is called twice, once for the head, once for the footer. This means the loop that sets the number in the ID is run twice, resetting on the second instance, resulting in the doubled ID.

Simplest fix might be to increment the number sufficiently on one of the loops. e.g. adding between these lines

foreach( $stylesheets as $idx => $stylesheets_group ) {
foreach( $stylesheets_group as $media => $css ) {

 if ( $group ) { $idx += 1000; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant