No Admin-Bar in WP 3.1 (RC2) with "Optimize CSS Code"

Bug #696710 reported by gerobe on 2011-01-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autoptimize
Undecided
David

Bug Description

In the RC2 of WordPress 3.1 the new admin bar does not appear, if you select "Optimize CSS Code" in the Autoptimize plugin.

Related branches

gerobe (buettner-gmx) wrote :

I think I found the reason for this. Autoptimize seems to combine all CSS code no matter what media they refer to. There is the line:

<style type="text/css" media="print">#wpadminbar { display:none; }</style>

In the code and Autoptimize puts this in the combined css for the screen display. The result is, that the admin bar is not displayed anymore.

gerobe (buettner-gmx) wrote :

The error is still present in the final version of WP 3.1

It would be easy to fix this, but I'm not good in regular expressions. Maybe someone can help:

In /classes/minify-html.php the line 109 is responsible for the vanishing admin bar. This regular expression extracts every style-code no matter for which media it is written.

'/(\\s*)(<script\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'

this line must be modified not to catch scripts with the parameter media="print".

Is someone here who is able to modify this line?

Unfortunately it seems, that this good plugin is not maintained by the author anymore :(

David (amereservant) on 2011-08-17
Changed in autoptimize:
assignee: nobody → David (amereservant)
David (amereservant) on 2011-08-17
Changed in autoptimize:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers