I just upgraded the List Category Posts plugin from 0.18.3 to 0.21 and my website has failed.

I've determined that the difference causing the failure is that the previous version passes a string parameter to get_posts() while the new version sends the arguments as an array.

The problem is that the default value for post_parent=0 does not seem to have an effect when passed as a string (e.g. "?cat=55&post_parent=0") but it is being applied when the parameter is being passed as an array (e.g. array( 'cat'=>'55', 'post_parent'='0') ).

My posts are post_type='post', for which post_parent should not be applicable. Many of my posts have a post_parent value which is not zero. They were previously batch converted from pages and it appears that the conversion has left the post_parent value with the id of the previous parent page.

As a result of this, all those posts which were previously converted from pages with a parent have disappeared from my category lists.

Can anyone explain why the parameter is being applied as an array and not as a string.

Why is the default value for post_parent 0 fro the plugin, while it is empty for get_posts()?

1 Answer 1


Since version 0.19, the plugin sends an array to get_posts to support custom taxonomy (see here).

I just uploaded version 0.21.1 with a small bugfix, it doesn't pass the post_parent parameter to get_posts if you didn't set it. Please give the new version a try and let me know if it's working for you.

  • That's fixed it! Thanks for the rapid response. I had overcome the problem by doing an update in the posts table within MySQL to set the post_parent to 0 for all posts. However I think that your fix is more robust - leaving unused variables to their WP defaults (Null in this case) makes more sense. Nov 25, 2011 at 16:12
  • Sorry you had to go through that trouble! Yeah, the plugin still has some sloppy code I've been fixing when I get the time to code on it. Thanks for using it and reporting the bug! Nov 25, 2011 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.