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

Frank Goossens on "[Plugin: Autoptimize] Adding an Attribute to the Script Put Out by Inline and Defer CSS Option"

$
0
0

hmmm, have you looked into the autoptimize_filter_js_defer filter?

add_filter('autoptimize_filter_js_defer','aj_ao_override_defer',10,1);
function aj_ao_override_defer($defer) {
	if (your_condition === true) {
		return $defer." data-cfasync=\"false\"";
	} else {
		return $defer;
	}
}

where you would off course need to specify "your_condition" in the if-clause?

frank


Viewing all articles
Browse latest Browse all 14052

Trending Articles