Wordpress: Fixing Wordpress 2.5 Child Link System
Posted 3 months ago at 4:39 pm. 21 comments
So you’ve just upgraded to Wordpress 2.5 and all of a sudden you are greeted with an error that says something like this:
Warning: Invalid argument supplied for foreach() in wp-includes/post.php in line 1783
It’s something like that but basically this error only occurs if your page template tries to access a child list using the following:
1 | $childPages = get_page_children($page->ID, ''); |
It doesn’t really matter about any of the code other than the last bit. This worked before because the function get_page_children realized it was empty and replaced it with the right value it’s self. Well it doesn’t anymore so here is how you fix it.
Continue Reading…