bainternet / Tax-Meta-Class

A class for creating WordPress taxonomies custom fields
http://en.bainternet.info/2012/wordpress-taxonomies-extra-fields-the-easy-way
GNU General Public License v3.0
406 stars 111 forks source link

addPosts() method only returns 5 posts or pages #101

Closed elvismdev closed 8 years ago

elvismdev commented 9 years ago

Hi, I am trying to use this plugin to select a page or post into a tag taxonomy type. I installed a enabled the plugin properly and it shows me on the new or edit tag page the new added field, in this case I just want to use the dropdown for posts which is generated by the addPosts() method, however it only shows me 5 posts in the dropdown, while I have more than 50 posts there on the website. Might that be because I might be missing something or is this a bug?

Thanks

JohnGurin commented 9 years ago

There is some ambiguity with array_merge in addPosts method. Had the same problem. Figured this out:

$my_meta->addPosts(
 $prefix.'posts_field_id',
 array('args' => array('post_type' => 'your_type', 'posts_per_page' => -1)),
 array('name'=> __('My Posts ', 'tax-meta')));

Notice post_per_page parameter

elvismdev commented 9 years ago

Awesome man, it really does the trick so now I can have all my pages in a dropdown for the category taxonomy type. Hope @bainternet look into and include it as a patch for the code.

elvismdev commented 8 years ago

Thank you!