Skip to content

Instantly share code, notes, and snippets.

@jbma
Created April 16, 2016 08:49
Show Gist options
  • Save jbma/fc73395082aadb6d5e3ff5678c18edba to your computer and use it in GitHub Desktop.
Save jbma/fc73395082aadb6d5e3ff5678c18edba to your computer and use it in GitHub Desktop.
<?php
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
define('DONOTCACHEPAGE', true);
}
?>
Copy link

ghost commented Apr 16, 2016

This is working perfect

add_filter( 'init', 'no_cache_for_admins' ); function no_cache_for_admins() { if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) { define('DONOTCACHEPAGE', true); } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment