WordPress.org

Forums

Autoptimize
[resolved] Autoptimize and Media Queries (5 posts)

  1. jvwissen
    Member
    Posted 3 years ago #

    I'm having an issue with autoptimize plugin and responsive websites loading css with media queries like media="screen and (max-width: 940px)"

    The media tag is split on the space and thus only the 'screen' word is used and not the whole string.

    When changing line 47 in the classes/autoptimizeStyle.php file from:

    $media[] = current(explode(' ',trim($elem),2));

    to:

    $media[] = $elem;

    the media tags are correct.

    http://wordpress.org/extend/plugins/autoptimize/

  2. Frank Goossens
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the info & debugging jvwissen. No regressions from that change?

  3. jvwissen
    Member
    Posted 3 years ago #

    No issues found yet.
    The cached stylesheets are nicely grouped by full media tag string names.

  4. Frank Goossens
    Member
    Plugin Author

    Posted 3 years ago #

    Just committed a new version to the SVN trunk with this and some other fixes. You can download that build from http://downloads.wordpress.org/plugin/autoptimize.zip.

    Would be great if you could be one of the "beta testers" :-)

  5. jvwissen
    Member
    Posted 3 years ago #

    Cool! Thanks!

    No problem for "beta testing". Been using this plugin for a long time now :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.