Quantcast
Channel: WordPress.org Forums » [Autoptimize] Support
Viewing all articles
Browse latest Browse all 14094

Frank Goossens on "Autoptimize breaks WP Online Contracts"

$
0
0

yes, using the API you can, there's example code in autoptimize_helper.php_example;

assuming the posts with a contract have "contract" in the URL, this code will exclude those pages from optimizatoin:

add_filter('autoptimize_filter_noptimize','beloved_ao_noptimize',10,0);
function beloved_ao_noptimize() {
	if (strpos($_SERVER['REQUEST_URI'],'contract')!==false) {
		return true;
	} else {
		return false;
	}
}

hope this helps,
frank


Viewing all articles
Browse latest Browse all 14094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>