Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30904 closed defect (bug) (fixed)

Pass post type to count_user_posts() in get_the_author_posts();

Reported by: Caspie Owned by: SergeyBiryukov
Priority: normal Milestone: 4.2
Component: Posts, Post Types Version: 4.1
Severity: normal Keywords: has-patch
Cc: Focuses: template

Description

Prevents possible wrong posts count, return when no post type is passed - the default "post" is used. Related to the enhancement in #21364

Attachments (2)

30904.diff​ (398 bytes ) - added by Caspie 12 years ago.
pass post type
30904-tests.patch​ (743 bytes ) - added by tyxla 12 years ago.
Adding an assertion in the unit test Tests_User_Author::test_get_the_author_posts() that checks for the new $post->post_type parameter usage in the count_user_posts() call within get_the_author_posts().

Download all attachments as: .zip

Change History (7)

@Caspie
12 years ago

pass post type

#1 @Caspie
12 years ago

  • Keywords has-patch needs-testing added

#2 @Caspie
12 years ago

For cases when get_the_author_posts() is called and the current post is of a custom post type.

#3 @SergeyBiryukov
12 years ago

  • Keywords needs-unit-tests added; needs-testing removed
  • Milestone Awaiting Review → 4.2

@tyxla
12 years ago

Adding an assertion in the unit test Tests_User_Author::test_get_the_author_posts() that checks for the new $post->post_type parameter usage in the count_user_posts() call within get_the_author_posts().

#4 @tyxla
12 years ago

  • Keywords needs-unit-tests removed

#5 @SergeyBiryukov
12 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 31098:

Pass post type to count_user_posts() in get_the_author_posts().

props Caspie, tyxla.
fixes #30904.

Note: See TracTickets for help on using tickets.