Make WordPress Core


Ignore:
Timestamp:
10/04/2021 08:42:54 PM (4 months ago)
Author:
johnbillion
Message:

Docs: Miscellaneous inline documentation improvements, including:

  • Document the post statuses global as an array of stdClass objects
  • Document the taxonomies global as an array of WP_Taxonomy objects
  • Document the return value of the post count functions as stdClass objects
  • Fix some typos

See #53399

File:
1 edited

Legend:

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

    r51850 r51885  
    950950 * @since 2.0.0
    951951 *
    952  * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post..
     952 * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
    953953 * @return string|false Post status on success, false on failure.
    954954 */
     
    10781078 * @since 3.0.0
    10791079 *
    1080  * @global array $wp_post_statuses Inserts new post status object into the list
     1080 * @global stdClass[] $wp_post_statuses Inserts new post status object into the list
    10811081 *
    10821082 * @param string       $post_status Name of the post status.
     
    12021202 * @since 3.0.0
    12031203 *
    1204  * @global array $wp_post_statuses List of post statuses.
     1204 * @global stdClass[] $wp_post_statuses List of post statuses.
    12051205 *
    12061206 * @see register_post_status()
    12071207 *
    12081208 * @param string $post_status The name of a registered post status.
    1209  * @return object|null A post status object.
     1209 * @return stdClass|null A post status object.
    12101210 */
    12111211function get_post_status_object( $post_status ) {
     
    12241224 * @since 3.0.0
    12251225 *
    1226  * @global array $wp_post_statuses List of post statuses.
     1226 * @global stdClass[] $wp_post_statuses List of post statuses.
    12271227 *
    12281228 * @see register_post_status()
     
    28182818 * @param string $type Optional. Post type to retrieve count. Default 'post'.
    28192819 * @param string $perm Optional. 'readable' or empty. Default empty.
    2820  * @return object Number of posts for each status.
     2820 * @return stdClass Number of posts for each status.
    28212821 */
    28222822function wp_count_posts( $type = 'post', $perm = '' ) {
     
    28712871     * @since 3.7.0
    28722872     *
    2873      * @param object $counts An object containing the current post_type's post
    2874      *                       counts by status.
    2875      * @param string $type   Post type.
    2876      * @param string $perm   The permission to determine if the posts are 'readable'
    2877      *                       by the current user.
     2873     * @param stdClass $counts An object containing the current post_type's post
     2874     *                         counts by status.
     2875     * @param string   $type   Post type.
     2876     * @param string   $perm   The permission to determine if the posts are 'readable'
     2877     *                         by the current user.
    28782878     */
    28792879    return apply_filters( 'wp_count_posts', $counts, $type, $perm );
     
    28942894 * @param string|string[] $mime_type Optional. Array or comma-separated list of
    28952895 *                                   MIME patterns. Default empty.
    2896  * @return object An object containing the attachment counts by mime type.
     2896 * @return stdClass An object containing the attachment counts by mime type.
    28972897 */
    28982898function wp_count_attachments( $mime_type = '' ) {
     
    29132913     * @since 3.7.0
    29142914     *
    2915      * @param object          $counts    An object containing the attachment counts by
     2915     * @param stdClass        $counts    An object containing the attachment counts by
    29162916     *                                   mime type.
    29172917     * @param string|string[] $mime_type Array or comma-separated list of MIME patterns.
Note: See TracChangeset for help on using the changeset viewer.