Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#21640 closed enhancement (fixed)

Incorrect datatype for $post_type param in PHPDocs for count_many_users_posts

Reported by: willmot Owned by: ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.2
Component: Inline Docs Keywords: has-patch commit
Focuses: Cc:


count_many_users_posts has supported passing the post_type as a second param since #17220 [17742] however the @param PHPDocs for the $post_type parameter incorrectly list the datatype as string|array when in-fact it should be string.

Passing an array causes a PHP error because the $post_type param is passed to get_posts_by_author_sql which assumes it is a string.

Warning: Illegal offset type in isset or empty in /wp-includes/post.php on line 840

Attached patch sets the PHPDocs @param datatype for the post_type param to string.

Attachments (1)

21640.diff (542 bytes) - added by willmot 9 years ago.

Download all attachments as: .zip

Change History (3)

9 years ago

#1 @SergeyBiryukov
9 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.5

#2 @ryan
9 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [21747]:

Update phpdoc for count_many_users_posts(). Props willmot. fixes #21640

Note: See TracTickets for help on using tickets.