Advertisement
retesere20

--recycle-saved

Jan 21st, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public function WP_debug_tests(){
  2. if (isset($_GET['WP_DEBUG'])) {
  3. $val = sanitize_key($_GET['WP_DEBUG']);
  4. setcookie('site_debug_enabled', $val, time() + ($val==0 ? -1000000 : 1000000000), "/");
  5. header("location: ". str_replace('?debug='.$val,'' ,$_SERVER['REQUEST_URI'])) ; exit;
  6. }
  7. if (isset($_COOKIE['site_debug_enabled'])) {
  8. define("WP_DEBUG",true);
  9. define("WP_DEBUG_LOG",true);
  10. define("WP_DEBUG_DISPLAY",true);
  11. }
  12. else {
  13. define('WP_DEBUG', false);
  14. define('WP_DEBUG_LOG', false);
  15. define('WP_DEBUG_DISPLAY', false);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement