From f1b07f779fdfb548db45e93eb777067e05cdfb77 Mon Sep 17 00:00:00 2001 From: Eric Andrew Lewis Date: Fri, 11 Dec 2015 03:49:40 +0000 Subject: [PATCH] Add inline documentation for `get_page_by_path()`. Fixes #34964. git-svn-id: https://develop.svn.wordpress.org/trunk@35861 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 10ee07b20a..c12c616991 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -4122,6 +4122,11 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { if ( $page->post_name == $revparts[0] ) { $count = 0; $p = $page; + + /* + * Loop through the given path parts from right to left, + * ensuring each matches the post ancestry. + */ while ( $p->post_parent != 0 && isset( $pages[ $p->post_parent ] ) ) { $count++; $parent = $pages[ $p->post_parent ];