[wp-trac] [WordPress Trac] #31677: count_user_posts is not working in wordpress 4.1

WordPress Trac noreply at wordpress.org
Wed Jun 28 13:55:00 UTC 2017


#31677: count_user_posts is not working in wordpress 4.1
-------------------------------+-----------------------
 Reporter:  stark.manish       |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+-----------------------
Changes (by jberculo):

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 I am having problems too. The function is accepting a second parameter,
 but it seems to ignore it. I am calling the function as follows:

 {{{#!php
 <?php
 echo count_user_posts($author_id, $post_type);
 }}}

 This always results in the amount of posts for the default post type being
 returned, instead of the actual count for the supplied post type.

 I am using Wordpress 4.8

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31677#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list