Skip to content

Instantly share code, notes, and snippets.

@yunusga
Created April 5, 2017 11:55
Show Gist options
  • Save yunusga/33cf0ba9e311e12df4046722e93d4123 to your computer and use it in GitHub Desktop.
Save yunusga/33cf0ba9e311e12df4046722e93d4123 to your computer and use it in GitHub Desktop.

Revisions

  1. @soulseekah soulseekah revised this gist May 3, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ function debug_404_rewrite_dump( &$wp ) {
    echo '<h2>permalink structure</h2>';
    echo var_export( $wp_rewrite->permalink_structure, true );

    echo '<h2>page permastruct</h2>;
    echo '<h2>page permastruct</h2>';
    echo var_export( $wp_rewrite->get_page_permastruct(), true );

    echo '<h2>matched rule and query</h2>';
  2. @soulseekah soulseekah revised this gist Apr 11, 2012. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,9 @@ function debug_404_rewrite_dump( &$wp ) {
    echo '<h2>rewrite rules</h2>';
    echo var_export( $wp_rewrite->wp_rewrite_rules(), true );

    echo '<h2>permalink structure</h2>';
    echo var_export( $wp_rewrite->permalink_structure, true );

    echo '<h2>page permastruct</h2>;
    echo var_export( $wp_rewrite->get_page_permastruct(), true );

  3. @soulseekah soulseekah revised this gist Apr 11, 2012. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,9 @@ function debug_404_rewrite_dump( &$wp ) {
    echo '<h2>rewrite rules</h2>';
    echo var_export( $wp_rewrite->wp_rewrite_rules(), true );

    echo '<h2>page permastruct</h2>;
    echo var_export( $wp_rewrite->get_page_permastruct(), true );

    echo '<h2>matched rule and query</h2>';
    echo var_export( $wp->matched_rule, true );

    @@ -30,7 +33,7 @@ add_action( 'template_redirect', 'debug_404_template_redirect', 99999 );
    function debug_404_template_redirect() {
    global $wp_filter;
    echo '<h2>template redirect filters</h2>';
    echo var_export( $wp_filter[current_filter()] );
    echo var_export( $wp_filter[current_filter()], true );
    }
    add_filter ( 'template_include', 'debug_404_template_dump' );
    function debug_404_template_dump( $template ) {
  4. @soulseekah soulseekah revised this gist Apr 6, 2012. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -26,8 +26,14 @@ function debug_404_rewrite_dump( &$wp ) {
    echo '<h2>the query</h2>';
    echo var_export( $wp_the_query, true );
    }
    add_action ( 'template_include', 'debug_404_template_dump' );
    function debug_404_template_dump( $template ) {
    add_action( 'template_redirect', 'debug_404_template_redirect', 99999 );
    function debug_404_template_redirect() {
    global $wp_filter;
    echo '<h2>template redirect filters</h2>';
    echo var_export( $wp_filter[current_filter()] );
    }
    add_filter ( 'template_include', 'debug_404_template_dump' );
    function debug_404_template_dump( $template ) {
    echo '<h2>template file selected</h2>';
    echo var_export( $template, true );

  5. @soulseekah soulseekah revised this gist Apr 6, 2012. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,12 @@ function debug_404_rewrite_dump( &$wp ) {
    global $wp_the_query;
    echo '<h2>the query</h2>';
    echo var_export( $wp_the_query, true );

    }
    add_action ( 'template_include', 'debug_404_template_dump' );
    function debug_404_template_dump( $template ) {
    echo '<h2>template file selected</h2>';
    echo var_export( $template, true );

    echo '</pre>';
    exit();
    }
  6. @soulseekah soulseekah revised this gist Apr 6, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -11,12 +11,12 @@ function debug_404_rewrite_dump( &$wp ) {
    global $wp_rewrite;

    echo '<h2>rewrite rules</h2>';
    echo var_export( $wp_rewrite, true );
    echo var_export( $wp_rewrite->wp_rewrite_rules(), true );

    echo '<h2>matched rule and query</h2>';
    echo var_export( $wp->matched_rule, true );

    echo '<h2>matched query</h2>;
    echo '<h2>matched query</h2>';
    echo var_export( $wp->matched_query, true );

    echo '<h2>request</h2>';
  7. @soulseekah soulseekah created this gist Apr 6, 2012.
    30 changes: 30 additions & 0 deletions gistfile1.aw
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    /* Produces a dump on the state of WordPress when a not found error occurs */
    /* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */

    ini_set( 'error_reporting', -1 );
    ini_set( 'display_errors', 'On' );

    echo '<pre>';

    add_action( 'parse_request', 'debug_404_rewrite_dump' );
    function debug_404_rewrite_dump( &$wp ) {
    global $wp_rewrite;

    echo '<h2>rewrite rules</h2>';
    echo var_export( $wp_rewrite, true );

    echo '<h2>matched rule and query</h2>';
    echo var_export( $wp->matched_rule, true );

    echo '<h2>matched query</h2>;
    echo var_export( $wp->matched_query, true );

    echo '<h2>request</h2>';
    echo var_export( $wp->request, true );

    global $wp_the_query;
    echo '<h2>the query</h2>';
    echo var_export( $wp_the_query, true );

    exit();
    }