WordPress.org

Make WordPress Core

Changeset 48591


Ignore:
Timestamp:
07/23/2020 09:53:43 PM (6 months ago)
Author:
SergeyBiryukov
Message:

Docs: Miscellaneous DocBlock corrections.

See #49572.

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

Legend:

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

    r48586 r48591  
    1515 *
    1616 * @param int|stdClass $bookmark
    17  * @param string       $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond
    18  *                               to an stdClass object, an associative array, or a numeric array, respectively.
    19  *                               Default OBJECT.
     17 * @param string       $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     18 *                               correspond to an stdClass object, an associative array, or a numeric array,
     19 *                               respectively. Default OBJECT.
    2020 * @param string       $filter   Optional. How to sanitize bookmark fields. Default 'raw'.
    2121 * @return array|object|null Type returned depends on $output value.
  • trunk/src/wp-includes/category.php

    r48586 r48591  
    8181 * @since 1.5.1
    8282 *
    83  * @param int|object $category Category ID or Category row object
    84  * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N,
    85  *                             which correspond to a WP_Term object, an associative array, or a numeric array,
     83 * @param int|object $category Category ID or category row object.
     84 * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     85 *                             correspond to a WP_Term object, an associative array, or a numeric array,
    8686 *                             respectively. Default OBJECT.
    8787 * @param string     $filter   Optional. How to sanitize category fields. Default 'raw'.
     
    117117 * @param string $category_path URL containing category slugs.
    118118 * @param bool   $full_match    Optional. Whether full path should be matched.
    119  * @param string $output        Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N,
    120  *                              which correspond to a WP_Term object, an associative array, or a numeric array,
     119 * @param string $output        Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     120 *                              correspond to a WP_Term object, an associative array, or a numeric array,
    121121 *                              respectively. Default OBJECT.
    122122 * @return WP_Term|array|WP_Error|null Type is based on $output value.
     
    330330 *
    331331 * @param int|WP_Term|object $tag    A tag ID or object.
    332  * @param string             $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N,
    333  *                                   which correspond to a WP_Term object, an associative array, or a numeric array,
     332 * @param string             $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     333 *                                   correspond to a WP_Term object, an associative array, or a numeric array,
    334334 *                                   respectively. Default OBJECT.
    335335 * @param string             $filter Optional. How to sanitize tag fields. Default 'raw'.
     
    372372 * @access private
    373373 *
    374  * @param array|object|WP_Term $category Category Row object or array
     374 * @param array|object|WP_Term $category Category row object or array.
    375375 */
    376376function _make_cat_compat( &$category ) {
  • trunk/src/wp-includes/class-wp-user.php

    r48590 r48591  
    5757     *
    5858     * @since 2.0.0
    59      * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values
    60      *             represent whether the user has that capability.
     59     * @var bool[] Array of key/value pairs where keys represent a capability name
     60     *             and boolean values represent whether the user has that capability.
    6161     */
    6262    public $caps = array();
     
    8282     *
    8383     * @since 2.0.0
    84      * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values
    85      *             represent whether the user has that capability.
     84     * @var bool[] Array of key/value pairs where keys represent a capability name
     85     *             and boolean values represent whether the user has that capability.
    8686     */
    8787    public $allcaps = array();
     
    483483
    484484    /**
    485      * Retrieves all of the capabilities of the roles of the user, and merges them with individual user capabilities.
    486      *
    487      * All of the capabilities of the roles of the user are merged with the user's individual capabilities. This means
    488      * that the user can be denied specific capabilities that their role might have, but the user is specifically denied.
    489      *
    490      * @since 2.0.0
    491      *
    492      * @return bool[] Array of key/value pairs where keys represent a capability name and boolean values
    493      *                represent whether the user has that capability.
     485     * Retrieves all of the capabilities of the user's roles, and merges them with
     486     * individual user capabilities.
     487     *
     488     * All of the capabilities of the user's roles are merged with the user's individual
     489     * capabilities. This means that the user can be denied specific capabilities that
     490     * their role might have, but the user is specifically denied.
     491     *
     492     * @since 2.0.0
     493     *
     494     * @return bool[] Array of key/value pairs where keys represent a capability name
     495     *                and boolean values represent whether the user has that capability.
    494496     */
    495497    public function get_role_caps() {
     
    767769         * @since 3.7.0 Added the `$user` parameter.
    768770         *
    769          * @param bool[]   $allcaps Array of key/value pairs where keys represent a capability name and boolean values
    770          *                          represent whether the user has that capability.
     771         * @param bool[]   $allcaps Array of key/value pairs where keys represent a capability name
     772         *                          and boolean values represent whether the user has that capability.
    771773         * @param string[] $caps    Required primitive capabilities for the requested capability.
    772774         * @param array    $args {
  • trunk/src/wp-includes/comment.php

    r48590 r48591  
    188188 *
    189189 * @param WP_Comment|string|int $comment Comment to retrieve.
    190  * @param string                $output  Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    191  *                                       a WP_Comment object, an associative array, or a numeric array, respectively. Default OBJECT.
     190 * @param string                $output  Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     191 *                                       correspond to a WP_Comment object, an associative array, or a numeric array,
     192 *                                       respectively. Default OBJECT.
    192193 * @return WP_Comment|array|null Depends on $output value.
    193194 */
  • trunk/src/wp-includes/functions.php

    r48590 r48591  
    75257525 *
    75267526 * @param string       $directory          Full path of a directory.
    7527  * @param string|array $exclude            Optional. Full path of a subdirectory to exclude from the total, or array of
    7528  *                                         paths. Expected without trailing slash(es).
    7529  * @param int          $max_execution_time Maximum time to run before giving up. In seconds.
    7530  *                                         The timeout is global and is measured from the moment WordPress started to load.
     7527 * @param string|array $exclude            Optional. Full path of a subdirectory to exclude from the total,
     7528 *                                         or array of paths. Expected without trailing slash(es).
     7529 * @param int          $max_execution_time Maximum time to run before giving up. In seconds. The timeout is global
     7530 *                                         and is measured from the moment WordPress started to load.
    75317531 * @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout.
    75327532 */
  • trunk/src/wp-includes/meta.php

    r48590 r48591  
    485485 *
    486486 * If the meta field does not exist, the result depends on get_metadata_default().
    487  * By default, an empty string is returned if `$single` is true, or an empty array if it's false.
     487 * By default, an empty string is returned if `$single` is true, or an empty array
     488 * if it's false.
    488489 *
    489490 * @since 2.9.0
     
    592593 * Retrieves default metadata value for the specified object.
    593594 *
    594  * By default, an empty string is returned if `$single` is true, or an empty array if it's false.
     595 * By default, an empty string is returned if `$single` is true, or an empty array
     596 * if it's false.
    595597 *
    596598 * @since 5.5.0
     
    14141416    }
    14151417
    1416     // If this meta type does not have sub types, then the default is keyed as an empty string.
     1418    // If this meta type does not have subtypes, then the default is keyed as an empty string.
    14171419    if ( isset( $defaults[''] ) ) {
    14181420        $metadata = $defaults[''];
  • trunk/src/wp-includes/post.php

    r48590 r48591  
    634634 *
    635635 * @param mixed  $args   Optional. User defined arguments for replacing the defaults. Default empty.
    636  * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    637  *                       a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     636 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     637 *                       correspond to a WP_Post object, an associative array, or a numeric array,
     638 *                       respectively. Default OBJECT.
    638639 * @return WP_Post[]|int[] Array of post objects or post IDs.
    639640 */
     
    752753 *
    753754 * @param int|WP_Post|null $post   Optional. Post ID or post object. Defaults to global $post.
    754  * @param string           $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    755  *                                 a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     755 * @param string           $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     756 *                                 correspond to a WP_Post object, an associative array, or a numeric array,
     757 *                                 respectively. Default OBJECT.
    756758 * @param string           $filter Optional. Type of filter to apply. Accepts 'raw', 'edit', 'db',
    757759 *                                 or 'display'. Default 'raw'.
     
    35063508 *
    35073509 * @param array  $args   Optional. Arguments to retrieve posts. Default empty array.
    3508  * @param string $output Optional. The required return type. One of OBJECT or ARRAY_A, which correspond to
    3509  *                       a WP_Post object or an associative array, respectively. Default ARRAY_A.
    3510  * @return array|false Array of recent posts, where the type of each element is determined by $output parameter.
    3511  *                     Empty array on failure.
     3510 * @param string $output Optional. The required return type. One of OBJECT or ARRAY_A, which
     3511 *                       correspond to a WP_Post object or an associative array, respectively.
     3512 *                       Default ARRAY_A.
     3513 * @return array|false Array of recent posts, where the type of each element is determined
     3514 *                     by the `$output` parameter. Empty array on failure.
    35123515 */
    35133516function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
     
    50495052 *
    50505053 * @param int|WP_Post $page   Page object or page ID. Passed by reference.
    5051  * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    5052  *                            a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     5054 * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     5055 *                            correspond to a WP_Post object, an associative array, or a numeric array,
     5056 *                            respectively. Default OBJECT.
    50535057 * @param string      $filter Optional. How the return value should be filtered. Accepts 'raw',
    50545058 *                            'edit', 'db', 'display'. Default 'raw'.
     
    50675071 *
    50685072 * @param string       $page_path Page path.
    5069  * @param string       $output    Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    5070  *                                a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     5073 * @param string       $output    Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     5074 *                                correspond to a WP_Post object, an associative array, or a numeric array,
     5075 *                                respectively. Default OBJECT.
    50715076 * @param string|array $post_type Optional. Post type or array of post types. Default 'page'.
    50725077 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
     
    51695174 *
    51705175 * @param string       $page_title Page title.
    5171  * @param string       $output     Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    5172  *                                 a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     5176 * @param string       $output     Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     5177 *                                 correspond to a WP_Post object, an associative array, or a numeric array,
     5178 *                                 respectively. Default OBJECT.
    51735179 * @param string|array $post_type  Optional. Post type or array of post types. Default 'page'.
    51745180 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
  • trunk/src/wp-includes/revision.php

    r48438 r48591  
    355355 *
    356356 * @param int|WP_Post $post   The post ID or object.
    357  * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    358  *                            a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     357 * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     358 *                            correspond to a WP_Post object, an associative array, or a numeric array,
     359 *                            respectively. Default OBJECT.
    359360 * @param string      $filter Optional sanitation filter. See sanitize_post().
    360361 * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
  • trunk/src/wp-includes/taxonomy.php

    r48590 r48591  
    840840 * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param.
    841841 *
    842  * @param int|WP_Term|object $term     If integer, term data will be fetched from the database, or from the cache if
    843  *                                     available. If stdClass object (as in the results of a database query), will apply
    844  *                                     filters and return a `WP_Term` object corresponding to the `$term` data. If
    845  *                                     `WP_Term`, will return `$term`.
    846  * @param string             $taxonomy Optional. Taxonomy name that $term is part of.
     842 * @param int|WP_Term|object $term     If integer, term data will be fetched from the database,
     843 *                                     or from the cache if available.
     844 *                                     If stdClass object (as in the results of a database query),
     845 *                                     will apply filters and return a `WP_Term` object with the `$term` data.
     846 *                                     If `WP_Term`, will return `$term`.
     847 * @param string             $taxonomy Optional. Taxonomy name that `$term` is part of.
    847848 * @param string             $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
    848  *                                     correspond toa WP_Term object, an associative array, or a numeric array
     849 *                                     correspond to a WP_Term object, an associative array, or a numeric array,
    849850 *                                     respectively. Default OBJECT.
    850851 * @param string             $filter   Optional. How to sanitize term fields. Default 'raw'.
    851  * @return WP_Term|array|WP_Error|null Object of the type specified by `$output` on success. When `$output` is 'OBJECT',
    852  *                                     a WP_Term instance is returned. If taxonomy does not exist, a WP_Error is
    853  *                                     returned. Returns null for miscellaneous failure.
     852 * @return WP_Term|array|WP_Error|null WP_Term instance (or array) on success, depending on the `$output` value.
     853 *                                     WP_Error if `$taxonomy` does not exist. Null for miscellaneous failure.
    854854 */
    855855function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
     
    957957 * @param string|int $value    Search for this term value.
    958958 * @param string     $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'.
    959  * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    960  *                             a WP_Term object, an associative array, or a numeric array, respectively. Default OBJECT.
     959 * @param string     $output   Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     960 *                             correspond to a WP_Term object, an associative array, or a numeric array,
     961 *                             respectively. Default OBJECT.
    961962 * @param string     $filter   Optional. How to sanitize term fields. Default 'raw'.
    962  * @return WP_Term|array|false WP_Term instance (or array) on success. Will return false if `$taxonomy` does not exist
    963  *                             or `$term` was not found.
     963 * @return WP_Term|array|false WP_Term instance (or array) on success, depending on the `$output` value.
     964 *                             False if `$taxonomy` does not exist or `$term` was not found.
    964965 */
    965966function get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
  • trunk/src/wp-includes/wp-db.php

    r48590 r48591  
    25772577     *
    25782578     * @param string|null $query  SQL query.
    2579      * @param string      $output Optional. The required return type. Possible values include
    2580      *                            OBJECT, ARRAY_A, or ARRAY_N, which correspond to an stdClass object,
    2581      *                            an associative array, or a numeric array, respectively. Default OBJECT.
     2579     * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
     2580     *                            correspond to an stdClass object, an associative array, or a numeric array,
     2581     *                            respectively. Default OBJECT.
    25822582     * @param int         $y      Optional. Row to return. Indexed from 0.
    25832583     * @return array|object|null|void Database query result in format specified by $output or null on failure.
Note: See TracChangeset for help on using the changeset viewer.