Cast to array in get_page_by_path() foreach
git-svn-id: http://svn.automattic.com/wordpress/trunk@18627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9813047aa0
commit
31a016614d
|
@ -3161,7 +3161,7 @@ function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
|
||||||
$revparts = array_reverse( $parts );
|
$revparts = array_reverse( $parts );
|
||||||
|
|
||||||
$foundid = 0;
|
$foundid = 0;
|
||||||
foreach ( $pages as $page ) {
|
foreach ( (array) $pages as $page ) {
|
||||||
if ( $page->post_name == $revparts[0] ) {
|
if ( $page->post_name == $revparts[0] ) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if ( $page->post_parent != 0 ) {
|
if ( $page->post_parent != 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue