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
This commit is contained in:
parent
26e7188154
commit
f1b07f779f
@ -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 ];
|
||||
|
Loading…
Reference in New Issue
Block a user