Skip to content

Instantly share code, notes, and snippets.

@scribu
Created April 28, 2011 22:15
Show Gist options
  • Save scribu/947462 to your computer and use it in GitHub Desktop.
Save scribu/947462 to your computer and use it in GitHub Desktop.
Debug WP_Rewrite
<?php
function debug_rewrite() {
global $wp, $wp_rewrite;
if ( !current_user_can( 'manage_options' ) )
return;
echo '<pre>';
var_dump( $wp->matched_rule );
print_r( $wp_rewrite );
echo '</pre>';
}
add_action( 'template_redirect', 'debug_rewrite' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment