Cast to array in get_page_by_path() foreach
git-svn-id: https://develop.svn.wordpress.org/trunk@18627 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3e49774791
commit
8094c89b39
@ -3161,7 +3161,7 @@ function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
|
||||
$revparts = array_reverse( $parts );
|
||||
|
||||
$foundid = 0;
|
||||
foreach ( $pages as $page ) {
|
||||
foreach ( (array) $pages as $page ) {
|
||||
if ( $page->post_name == $revparts[0] ) {
|
||||
$count = 0;
|
||||
if ( $page->post_parent != 0 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user