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.
Built from https://develop.svn.wordpress.org/trunk@56120


git-svn-id: http://core.svn.wordpress.org/trunk@55632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-07-01 10:04:26 +00:00
parent d87c35b008
commit afa826e356
2 changed files with 3 additions and 2 deletions

View File

@ -3034,7 +3034,8 @@ function _count_posts_cache_key( $type = 'post', $perm = '' ) {
*
* @param string $type Optional. Post type to retrieve count. Default 'post'.
* @param string $perm Optional. 'readable' or empty. Default empty.
* @return stdClass Number of posts for each status.
* @return stdClass An object containing the number of posts for each status,
* or an empty object if the post type does not exist.
*/
function wp_count_posts( $type = 'post', $perm = '' ) {
global $wpdb;

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.3-beta2-56119';
$wp_version = '6.3-beta2-56120';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.