Guest User

Untitled

a guest
Jul 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Hook into supercache to disable it for mobile sites
  5. *
  6. * Needed because otherwise mobile agents recognized by mobile edition
  7. * but not supercache end up caching to the general pool, and visitors
  8. * see the mobile versions.
  9. *
  10. * Until the supercache list updates itself dynamically this will mean
  11. * that mobile agents unknown to supercache will get inconsistent results
  12. * but that the main mobile agents will consistently see uncached pages and
  13. * browser visitors will see cached versions of the regular theme.
  14. */
  15. function gv_turn_off_caching_for_mobile() {
  16. if (function_exists('cfmobi_check_mobile') AND cfmobi_check_mobile()) :
  17. define('DONOTCACHEPAGE', TRUE);
  18. endif;
  19. }
  20. add_action('init', 'gv_turn_off_caching_for_mobile');
  21.  
  22. ?>
Add Comment
Please, Sign In to add comment