Last active
December 11, 2015 10:58
-
-
Save shimondoodkin/4590653 to your computer and use it in GitHub Desktop.
helps debug canonical url wordpress -
replace all wp_redirect function calls with calls to exit_redirect function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
function exit_redirect($url,$status){ //wp_redirect | |
//return wp_redirect($url,$status); // uncomment to temporarly disable | |
while(ob_get_level())ob_end_flush(); | |
if ( !$requested_url ) { | |
// build the URL in the address bar | |
$requested_url = is_ssl() ? 'https://' : 'http://'; | |
$requested_url .= $_SERVER['HTTP_HOST']; | |
$requested_url .= $_SERVER['REQUEST_URI']; | |
} | |
echo "<xmp>"; | |
debug_print_backtrace(); | |
echo "\r\n"; | |
echo $url; | |
echo "\r\n"; | |
echo $requested_url; | |
echo "\r\n"; | |
echo "</xmp>"; | |
exit(); | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment