Skip to content

get_post_ancestors() not working when links are included as pages #9

Description

@PaulCornelissen

When you set links to open as pages in Wordpress the get_post_ancestors is not working (return null instead of array()) which caused this error:
Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/..../wp-includes/nav-menu-template.php on line 607 Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/..../wp-includes/nav-menu-template.php on line 607

I fixed this by adding this after line 445 of WikiEmbed.php:
$post->ancestors = array();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions