Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PaulCornelissen opened this issue Jun 3, 2015 · 0 comments

Comments

@PaulCornelissen
Copy link

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant