Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 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:

Description

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.


15 months ago
#1

  • Keywords has-patch added

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

Trac ticket: https://core.trac.wordpress.org/ticket/58685

#2 @crstauf
15 months ago

Reported by @ov3rfly in User Contributed Notes.

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

#3 @crstauf
15 months ago

  • Focuses docs added

#4 @SergeyBiryukov
15 months ago

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

#5 @SergeyBiryukov
15 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:


15 months ago
#6

Thanks for the PR! Merged in r56120.

Note: See TracTickets for help on using tickets.