WordPress.org

Make WordPress Core

Changeset 2435


Ignore:
Timestamp:
03/13/2005 01:24:18 AM (15 years ago)
Author:
ryan
Message:

Don't allow a page to be its own parent. http://mosquito.wordpress.org/view.php?id=1095

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/template-functions-post.php

    r2421 r2435  
    349349        // We can now start looping over the $page_tree array
    350350        // with any ID which will output the page links from that ID downwards.
    351         $page_tree[$page->post_parent]['children'][] = $page->ID;
     351        if ( $page->post_parent != $page->ID)
     352            $page_tree[$page->post_parent]['children'][] = $page->ID;
    352353    }
    353354    // Output of the pages starting with child_of as the root ID.
Note: See TracChangeset for help on using the changeset viewer.