Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#58685 closed defect (bug) (fixed)

Fix return description for wp_count_posts()

Reported by: crstauf's profile crstauf Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: docs Cc:


If post type passed to wp_count_posts() does not exist, function returns an empty stdClass: adjust the @return description to indicate this.

Change History (6)

This ticket was mentioned in PR #4769 on WordPress/wordpress-develop by @crstauf.

12 months ago

  • Keywords has-patch added

Update @return description for wp_count_posts() to include returned value if post type is invalid.

Trac ticket:

#2 @crstauf
12 months ago

Reported by @ov3rfly in User Contributed Notes.

Last edited 12 months ago by crstauf (previous) (diff)

#3 @crstauf
12 months ago

  • Focuses docs added

#4 @SergeyBiryukov
12 months ago

  • Component changed from General to Posts, Post Types
  • Milestone changed from Awaiting Review to 6.3

#5 @SergeyBiryukov
12 months ago

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

In 56120:

Docs: Correct @return description for wp_count_posts().

Add a note that wp_count_posts() returns an empty object if the post type passed to the function does not exist.

Follow-up to [6730], [6808], [8081], [24826], [29093], [51885].

Props crstauf, Ov3rfly.
Fixes #58685.

@SergeyBiryukov commented on PR #4769:

12 months ago

Thanks for the PR! Merged in r56120.

Note: See TracTickets for help on using tickets.