Permalink
Browse files

2nd attempt at excluding AMP-pages

when WP AMP was installed the constant was always set, so non-AMP pages
weren't autoptimized either. now excluding based on amp-attribute on the
HTML tag.
  • Loading branch information...
futtta committed Jan 20, 2016
1 parent f77086b commit 0f91b3301f3269747399a67b00510c987a8ec57f
Showing with 1 addition and 1 deletion.
  1. +1 −1 autoptimize.php
@@ -184,7 +184,7 @@ function autoptimize_start_buffering() {
// Action on end, this is where the magic happens
function autoptimize_end_buffering($content) {
if ( stripos($content,"<html") === false || stripos($content,"<xsl:stylesheet") !== false ) { return $content;}
if ( stripos($content,"<html") === false || stripos($content,"<html amp") !== false || stripos($content,"<xsl:stylesheet") !== false ) { return $content;}
// load URL constants as late as possible to allow domain mapper to kick in
if (function_exists("domain_mapping_siteurl")) {

0 comments on commit 0f91b33

Please sign in to comment.