Make WordPress Core

Changeset 49926


Ignore:
Timestamp:
01/03/2021 09:55:04 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Various docblock corrections particularly relating to boolean types.

See #51800

Location:
trunk/src
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-community-events.php

    r49201 r49926  
    4040     *
    4141     * @param int        $user_id       WP user ID.
    42      * @param bool|array $user_location Stored location data for the user.
    43      *                                  false to pass no location;
    44      *                                  array to pass a location {
     42     * @param false|array $user_location {
     43     *     Stored location data for the user. false to pass no location.
     44     *
    4545     *     @type string $description The name of the location
    4646     *     @type string $latitude    The latitude in decimal degrees notation, without the degree
  • trunk/src/wp-admin/includes/dashboard.php

    r49725 r49926  
    15391539 * @since 3.0.0
    15401540 *
    1541  * @return bool|null True if not multisite, user can't upload files, or the space check option is disabled.
     1541 * @return true|void True if not multisite, user can't upload files, or the space check option is disabled.
    15421542 */
    15431543function wp_dashboard_quota() {
  • trunk/src/wp-admin/includes/deprecated.php

    r49599 r49926  
    129129 * @param int $level         Optional. Number of levels deep to display. Default 0.
    130130 * @param array $categories  Optional. Categories to include in the control. Default 0.
    131  * @return bool|null False if no categories were found.
     131 * @return false|void False if no categories were found.
    132132 */
    133133function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
  • trunk/src/wp-admin/includes/image.php

    r49021 r49926  
    10151015         * @since 3.1.0
    10161016         *
    1017          * @param string      $image_url     Current image URL.
     1017         * @param string|false $image_url     Current image URL.
    10181018         * @param int          $attachment_id Attachment ID.
    10191019         * @param string|int[] $size          Requested image size. Can be any registered image size name, or
  • trunk/src/wp-admin/includes/translation-install.php

    r47929 r49926  
    3030     * @since 4.0.0
    3131     *
    32      * @param bool|array $result The result object. Default false.
    33      * @param string      $type   The type of translations being requested.
    34      * @param object      $args   Translation API arguments.
     32     * @param false|object $result The result object. Default false.
     33     * @param string       $type   The type of translations being requested.
     34     * @param object       $args   Translation API arguments.
    3535     */
    3636    $res = apply_filters( 'translations_api', false, $type, $args );
  • trunk/src/wp-includes/category-template.php

    r49693 r49926  
    816816 *                                                'DESC' (descending), or 'RAND' (random). Default 'ASC'.
    817817 *     @type int|bool $filter                     Whether to enable filtering of the final output
    818  *                                                via {@see 'wp_generate_tag_cloud'}. Default 1|true.
     818 *                                                via {@see 'wp_generate_tag_cloud'}. Default 1.
    819819 *     @type string   $topic_count_text           Nooped plural text from _n_noop() to supply to
    820820 *                                                tag counts. Default null.
  • trunk/src/wp-includes/class-wp-hook.php

    r49489 r49926  
    187187    /**
    188188     * Checks if a specific action has been registered for this hook.
     189     *
     190     * When using the $function_to_check argument, this function may return a non-boolean value
     191     * that evaluates to false (e.g. 0), so use the === operator for testing the return value.
    189192     *
    190193     * @since 4.7.0
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r49546 r49926  
    292292     * @param string $filter_name Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'.
    293293     * @param bool   $strip_meta  Optional. Strip all profiles, excluding color profiles, from the image. Default true.
    294      * @return bool|WP_Error
     294     * @return void|WP_Error
    295295     */
    296296    protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = true ) {
  • trunk/src/wp-includes/class-wp-metadata-lazyloader.php

    r47153 r49926  
    7171     * @param string $object_type Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'.
    7272     * @param array  $object_ids  Array of object IDs.
    73      * @return bool|WP_Error True on success, WP_Error on failure.
     73     * @return void|WP_Error WP_Error on failure.
    7474     */
    7575    public function queue_objects( $object_type, $object_ids ) {
     
    111111     *
    112112     * @param string $object_type Object type. Accepts 'comment' or 'term'.
    113      * @return bool|WP_Error True on success, WP_Error on failure.
     113     * @return void|WP_Error WP_Error on failure.
    114114     */
    115115    public function reset_queue( $object_type ) {
  • trunk/src/wp-includes/comment.php

    r49215 r49926  
    24072407     * @since 1.5.0
    24082408     *
    2409      * @param int         $comment_id     Comment ID.
    2410      * @param string|bool $comment_status Current comment status. Possible values include
    2411      *                                    'hold', 'approve', 'spam', 'trash', or false.
     2409     * @param int    $comment_id     Comment ID.
     2410     * @param string $comment_status Current comment status. Possible values include
     2411     *                               'hold', '0', 'approve', '1, 'spam', and 'trash'.
    24122412     */
    24132413    do_action( 'wp_set_comment_status', $comment->comment_ID, $comment_status );
  • trunk/src/wp-includes/formatting.php

    r49858 r49926  
    55465546 * @since 3.6.0
    55475547 *
    5548  * @param string|string[] $value String or array of strings to unslash.
    5549  * @return string|string[] Unslashed $value
     5548 * @param string|array $value String or array of strings to unslash.
     5549 * @return string|array Unslashed $value
    55505550 */
    55515551function wp_unslash( $value ) {
  • trunk/src/wp-includes/functions.php

    r49907 r49926  
    838838 * @param string|null $content Post content. If `null`, the `post_content` field from `$post` is used.
    839839 * @param int|WP_Post $post    Post ID or post object.
    840  * @return null|bool Returns false if post is not found.
     840 * @return void|false Returns false if post is not found.
    841841 */
    842842function do_enclose( $content, $post ) {
  • trunk/src/wp-includes/plugin.php

    r49196 r49926  
    134134 *                   hook is returned, or false if the function is not attached. When using the
    135135 *                   $function_to_check argument, this function may return a non-boolean value
    136  *                   that evaluates to false (e.g.) 0, so use the === operator for testing the
     136 *                   that evaluates to false (e.g. 0), so use the === operator for testing the
    137137 *                   return value.
    138138 */
     
    567567 *                  hook is returned, or false if the function is not attached. When using the
    568568 *                  $function_to_check argument, this function may return a non-boolean value
    569  *                  that evaluates to false (e.g.) 0, so use the === operator for testing the
     569 *                  that evaluates to false (e.g. 0), so use the === operator for testing the
    570570 *                  return value.
    571571 */
  • trunk/src/wp-includes/post.php

    r49905 r49926  
    61046104     * @since 2.1.0
    61056105     *
    6106      * @param array|bool $data          Array of meta data for the given attachment, or false
    6107      *                                  if the object does not exist.
    6108      * @param int        $attachment_id Attachment post ID.
     6106     * @param array $data          Array of meta data for the given attachment.
     6107     * @param int   $attachment_id Attachment post ID.
    61096108     */
    61106109    return apply_filters( 'wp_get_attachment_metadata', $data, $attachment_id );
  • trunk/src/wp-includes/user.php

    r49919 r49926  
    15381538 *
    15391539 * @param object|WP_User $user User object or database row to be cached
    1540  * @return bool|null Returns false on failure.
     1540 * @return false|void Returns false on failure.
    15411541 */
    15421542function update_user_caches( $user ) {
Note: See TracChangeset for help on using the changeset viewer.