sure, with a couple of lines of PHP hooking into AO’s API using the autoptimize_filter_css_defer filter 🙂
hope this helps,
frank
In reference if someone need it, this includes all logged in users admins, editors all of them:
add_filter('autoptimize_filter_css_defer','really_bail_loggedin',10,0);
function really_bail_loggedin() {
if ( ! is_user_logged_in() ) {
return true;
} else {
return false;
}
}
Thanks Frank;
-
This reply was modified 4 years, 9 months ago by
omusman.
-
This reply was modified 4 years, 9 months ago by
omusman.
great job Omusman! 🙂
Now this was stupid of me, because while looking at the code I realize that in Settings -> Autoptimize -> Critical CSS -> Advanced Settings there is … “Add CCSS for logged in users?”, unticking that would do the same as your code snippet …
Sorry for forcing you write code when it wasn’t really needed omusman 😉
frank