Skip to content

Commit

Permalink
Correct condition to check if page has a parent
Browse files Browse the repository at this point in the history
  • Loading branch information
mashikag committed Jan 11, 2023
1 parent a136bd6 commit f443fa3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private static function to_pages_by_id( $pages ) {
private static function to_pages_by_parent( $pages ) {
$pages_by_parent = array();
foreach ( $pages as $page ) {
if ( isset( $page->post_parent ) ) {
if ( ! empty( $page->post_parent ) ) {
$pages_by_parent[ $page->post_parent ][] = $page;
} else {
$pages_by_parent['root'][] = $page;
Expand Down

0 comments on commit f443fa3

Please sign in to comment.