WordPress.org

Make WordPress Core

#35222 closed enhancement (fixed)

count_user_posts() - change docs to return string instead of int

Reported by: nofearinc Owned by: SergeyBiryukov
Milestone: 4.5 Priority: normal
Severity: minor Version:
Component: Users Keywords: has-patch
Focuses: docs Cc:

Description

As seen in a tweet by Rarst and tested locally, count_user_posts returns the number of posts from a user as a string instead of int calling $wpdb->get_var. Since people may validate against strings or compare accordingly, a safe bet is letting IDEs know that the return type is string.

Attachments (1)

35222.diff (749 bytes) - added by nofearinc 16 months ago.

Download all attachments as: .zip

Change History (4)

@nofearinc
16 months ago

#2 @SergeyBiryukov
16 months ago

  • Milestone changed from Awaiting Review to 4.5

#3 @SergeyBiryukov
16 months ago

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

In 36085:

Docs: Correct @return type for count_user_posts().

Props nofearinc.
Fixes #35222.

Note: See TracTickets for help on using tickets.