WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
No Admin-Bar in WP 3.1 (RC1) with "Optimize CSS Code" (4 posts)

  1. gerobe
    Member
    Posted 3 years ago #

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

  2. gerobe
    Member
    Posted 3 years ago #

    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.

  3. blue-matrix
    Member
    Posted 3 years ago #

    Für WordPress Version 3.1 ist das Problem mit der WP-Adminbar noch nicht behoben. Die Adminbar wird einfach nicht abgezeigt.

    Schade.

  4. gerobe
    Member
    Posted 3 years ago #

    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 :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic