WordPress.org

Make WordPress Core

Changeset 51885


Ignore:
Timestamp:
10/04/2021 08:42:54 PM (2 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

Location:
trunk/src/wp-includes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r51047 r51885  
    13351335     * @since 4.7.0
    13361336     *
    1337      * @global array $wp_post_statuses List of post statuses.
     1337     * @global stdClass[] $wp_post_statuses List of post statuses.
    13381338     */
    13391339    public function make_auto_draft_status_previewable() {
  • trunk/src/wp-includes/class-wp-query.php

    r51514 r51885  
    38563856     * @since 3.1.0
    38573857     *
    3858      * @global array $wp_taxonomies
     3858     * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies.
    38593859     *
    38603860     * @param string|string[]           $taxonomy Optional. Taxonomy slug or slugs to check against.
  • trunk/src/wp-includes/functions.php

    r51793 r51885  
    15341534 *
    15351535 * @param string $yn Character string containing either 'y' (yes) or 'n' (no).
    1536  * @return bool True if yes, false on anything else.
     1536 * @return bool True if 'y', false on anything else.
    15371537 */
    15381538function bool_from_yn( $yn ) {
  • 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.
  • trunk/src/wp-includes/taxonomy.php

    r51837 r51885  
    199199 * @since 3.0.0
    200200 *
    201  * @global array $wp_taxonomies The registered taxonomies.
     201 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    202202 *
    203203 * @param array  $args     Optional. An array of `key => value` arguments to match against the taxonomy objects.
     
    232232 * @since 2.3.0
    233233 *
    234  * @global array $wp_taxonomies The registered taxonomies.
     234 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    235235 *
    236236 * @param string|string[]|WP_Post $object Name of the type of taxonomy object, or an object (row from posts)
     
    273273 * @since 2.3.0
    274274 *
    275  * @global array $wp_taxonomies The registered taxonomies.
     275 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    276276 *
    277277 * @param string $taxonomy Name of taxonomy object to return.
     
    299299 * @since 3.0.0
    300300 *
    301  * @global array $wp_taxonomies The registered taxonomies.
     301 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    302302 *
    303303 * @param string $taxonomy Name of taxonomy object.
     
    357357 * @since 5.5.0 Introduced `default_term` argument.
    358358 *
    359  * @global array $wp_taxonomies Registered taxonomies.
     359 * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies.
    360360 *
    361361 * @param string       $taxonomy    Taxonomy key, must not exceed 32 characters.
     
    508508 *
    509509 * @global WP    $wp            Current WordPress environment instance.
    510  * @global array $wp_taxonomies List of taxonomies.
     510 * @global WP_Taxonomy[] $wp_taxonomies List of taxonomies.
    511511 *
    512512 * @param string $taxonomy Taxonomy name.
     
    685685 * @since 3.0.0
    686686 *
    687  * @global array $wp_taxonomies The registered taxonomies.
     687 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    688688 *
    689689 * @param string $taxonomy    Name of taxonomy object.
     
    727727 * @since 3.7.0
    728728 *
    729  * @global array $wp_taxonomies The registered taxonomies.
     729 * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies.
    730730 *
    731731 * @param string $taxonomy    Name of taxonomy object.
Note: See TracChangeset for help on using the changeset viewer.