Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Stops Advanced AJAX Page Loader plugin from loading
  5. * when used with the AppPresser plugin.
  6. *
  7. * Add this file to the wp-content/mu-plugins/ folder.
  8. */
  9.  
  10. add_action('plugins_loaded', 'remove_aapl');
  11.  
  12.  
  13. function remove_aapl() {
  14. if( is_appp_request() ) {
  15. remove_action('wp_head', 'insert_head_AAPL');
  16. remove_action('wp_footer', 'insert_foot_AAPL');
  17. remove_action('wp_enqueue_scripts', 'enqueue_AAPL');
  18. }
  19. }
  20.  
  21. function is_appp_request() {
  22. $is_apppv = 0;
  23.  
  24. if( isset( $_GET['appp'] ) && $_GET['appp'] == 3 || isset( $_COOKIE['AppPresser_Appp3'] ) && $_COOKIE['AppPresser_Appp3'] === 'true' ) {
  25. $is_apppv = 3;
  26. } else if( isset( $_GET['appp'] ) && $_GET['appp'] == 2 || isset( $_COOKIE['AppPresser_Appp2'] ) && $_COOKIE['AppPresser_Appp2'] === 'true' ) {
  27. $is_apppv = 2;
  28. } else if( ( isset( $_GET['appp'] ) && $_GET['appp'] == 1 ) || isset( $_COOKIE['AppPresser_Appp'] ) && $_COOKIE['AppPresser_Appp'] === 'true' ) {
  29. $is_apppv = 1;
  30. }
  31.  
  32. return $is_apppv;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement