Make WordPress Core

Changeset 56120


Ignore:
Timestamp:
07/01/2023 10:02:05 AM (16 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r56053 r56120  
    30353035 * @param string $type Optional. Post type to retrieve count. Default 'post'.
    30363036 * @param string $perm Optional. 'readable' or empty. Default empty.
    3037  * @return stdClass Number of posts for each status.
     3037 * @return stdClass An object containing the number of posts for each status,
     3038 *                  or an empty object if the post type does not exist.
    30383039 */
    30393040function wp_count_posts( $type = 'post', $perm = '' ) {
Note: See TracChangeset for help on using the changeset viewer.