ubc / wiki-embed

WordPress plugin that lets you embed mediawiki pages into your site, sites like Wikipedia
19 stars 10 forks source link

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

Open PaulCornelissen opened 9 years ago

PaulCornelissen commented 9 years ago

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