| 3167 | | if ( $page->post_parent != 0 ) { |
| 3168 | | if ( null === ( $parent_page = $pages[ $page->post_parent ] ) ) |
| 3169 | | continue; |
| 3170 | | |
| 3171 | | while ( $parent_page->ID != 0 ) { |
| 3172 | | $count++; |
| 3173 | | if ( $parent_page->post_name != $revparts[ $count ] ) |
| 3174 | | break; |
| 3175 | | $parent_page = $pages[ $parent_page->post_parent ]; |
| 3176 | | } |
| 3177 | | |
| 3178 | | if ( $parent_page->ID == 0 && $count+1 == count($revparts) ) { |
| 3179 | | $foundid = $page->ID; |
| | 3167 | $p = $page; |
| | 3168 | while ( $p->post_parent != 0 && isset( $pages[ $p->post_parent ] ) ) { |
| | 3169 | $count++; |
| | 3170 | $parent = $pages[ $p->post_parent ]; |
| | 3171 | if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) |