Make WordPress Core

Changeset 49936


Ignore:
Timestamp:
01/05/2021 05:14:24 PM (4 years ago)
Author:
johnbillion
Message:

Docs: Corrections and improvements to types used in various docblocks.

See #51800, #52217

Location:
trunk/src
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-walker-nav-menu-checklist.php

    r49108 r49936  
    1616class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
    1717    /**
    18      * @param array $fields
     18     * @param array|false $fields Database fields to use.
    1919     */
    2020    public function __construct( $fields = false ) {
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r48835 r49936  
    788788     * @abstract
    789789     *
    790      * @param string     $path  Path for new directory.
    791      * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
    792      *                          Default false.
    793      * @param string|int $chown Optional. A user name or number (or false to skip chown).
    794      *                          Default false.
    795      * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
    796      *                          Default false.
     790     * @param string           $path  Path for new directory.
     791     * @param int|false        $chmod Optional. The permissions as octal number (or false to skip chmod).
     792     *                                Default false.
     793     * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
     794     *                                Default false.
     795     * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
     796     *                                Default false.
    797797     * @return bool True on success, false on failure.
    798798     */
  • trunk/src/wp-admin/includes/class-wp-filesystem-direct.php

    r48089 r49936  
    522522     * @since 2.5.0
    523523     *
    524      * @param string     $path  Path for new directory.
    525      * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
    526      *                          Default false.
    527      * @param string|int $chown Optional. A user name or number (or false to skip chown).
    528      *                          Default false.
    529      * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
    530      *                          Default false.
     524     * @param string           $path  Path for new directory.
     525     * @param int|false        $chmod Optional. The permissions as octal number (or false to skip chmod).
     526     *                                Default false.
     527     * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
     528     *                                Default false.
     529     * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
     530     *                                Default false.
    531531     * @return bool True on success, false on failure.
    532532     */
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php

    r48797 r49936  
    542542     * @since 2.5.0
    543543     *
    544      * @param string     $path  Path for new directory.
    545      * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
    546      *                          Default false.
    547      * @param string|int $chown Optional. A user name or number (or false to skip chown).
    548      *                          Default false.
    549      * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
    550      *                          Default false.
     544     * @param string           $path  Path for new directory.
     545     * @param int|false        $chmod Optional. The permissions as octal number (or false to skip chmod).
     546     *                                Default false.
     547     * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
     548     *                                Default false.
     549     * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
     550     *                                Default false.
    551551     * @return bool True on success, false on failure.
    552552     */
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r48089 r49936  
    552552     * @since 2.5.0
    553553     *
    554      * @param string     $path  Path for new directory.
    555      * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
    556      *                          Default false.
    557      * @param string|int $chown Optional. A user name or number (or false to skip chown).
    558      *                          Default false.
    559      * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
    560      *                          Default false.
     554     * @param string           $path  Path for new directory.
     555     * @param int|false        $chmod Optional. The permissions as octal number (or false to skip chmod).
     556     *                                Default false.
     557     * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
     558     *                                Default false.
     559     * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
     560     *                                Default false.
    561561     * @return bool True on success, false on failure.
    562562     */
  • trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php

    r48586 r49936  
    672672     * @since 2.7.0
    673673     *
    674      * @param string     $path  Path for new directory.
    675      * @param int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
    676      *                          Default false.
    677      * @param string|int $chown Optional. A user name or number (or false to skip chown).
    678      *                          Default false.
    679      * @param string|int $chgrp Optional. A group name or number (or false to skip chgrp).
    680      *                          Default false.
     674     * @param string           $path  Path for new directory.
     675     * @param int|false        $chmod Optional. The permissions as octal number (or false to skip chmod).
     676     *                                Default false.
     677     * @param string|int|false $chown Optional. A user name or number (or false to skip chown).
     678     *                                Default false.
     679     * @param string|int|false $chgrp Optional. A group name or number (or false to skip chgrp).
     680     *                                Default false.
    681681     * @return bool True on success, false on failure.
    682682     */
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r49192 r49936  
    540540     * @since 3.3.0
    541541     *
    542      * @param string $option Option name.
    543      * @param string $key    Optional. Specific array key for when the option is an array.
    544      *                       Default false.
     542     * @param string       $option Option name.
     543     * @param string|false $key    Optional. Specific array key for when the option is an array.
     544     *                             Default false.
    545545     * @return string The option value if set, null otherwise.
    546546     */
  • trunk/src/wp-admin/includes/dashboard.php

    r49927 r49936  
    507507 * @global int $post_ID
    508508 *
    509  * @param string $error_msg Optional. Error message. Default false.
     509 * @param string|false $error_msg Optional. Error message. Default false.
    510510 */
    511511function wp_dashboard_quick_press( $error_msg = false ) {
     
    578578 * @since 2.7.0
    579579 *
    580  * @param WP_Post[] $drafts Optional. Array of posts to display. Default false.
     580 * @param WP_Post[]|false $drafts Optional. Array of posts to display. Default false.
    581581 */
    582582function wp_dashboard_recent_drafts( $drafts = false ) {
     
    11521152 * @global callable[] $wp_dashboard_control_callbacks
    11531153 *
    1154  * @param int $widget_control_id Registered Widget ID.
     1154 * @param int|false $widget_control_id Optional. Registered widget ID. Default false.
    11551155 */
    11561156function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
  • trunk/src/wp-admin/includes/file.php

    r49929 r49936  
    12561256 * @param string       $filename            The file to validate.
    12571257 * @param string|array $signatures          A Signature provided for the file.
    1258  * @param string       $filename_for_errors A friendly filename for errors. Optional.
     1258 * @param string|false $filename_for_errors Optional. A friendly filename for errors.
    12591259 * @return bool|WP_Error True on success, false if verification not attempted,
    12601260 *                       or WP_Error describing an error condition.
  • trunk/src/wp-admin/includes/image.php

    r49929 r49936  
    1212 * @since 2.1.0
    1313 *
    14  * @param string|int $src      The source file or Attachment ID.
    15  * @param int        $src_x    The start x position to crop from.
    16  * @param int        $src_y    The start y position to crop from.
    17  * @param int        $src_w    The width to crop.
    18  * @param int        $src_h    The height to crop.
    19  * @param int        $dst_w    The destination width.
    20  * @param int        $dst_h    The destination height.
    21  * @param bool       $src_abs  Optional. If the source crop points are absolute.
    22  * @param string    $dst_file Optional. The destination file to write to.
     14 * @param string|int   $src      The source file or Attachment ID.
     15 * @param int          $src_x    The start x position to crop from.
     16 * @param int          $src_y    The start y position to crop from.
     17 * @param int          $src_w    The width to crop.
     18 * @param int          $src_h    The height to crop.
     19 * @param int          $dst_w    The destination width.
     20 * @param int          $dst_h    The destination height.
     21 * @param bool|false   $src_abs  Optional. If the source crop points are absolute.
     22 * @param string|false $dst_file Optional. The destination file to write to.
    2323 * @return string|WP_Error New filepath on success, WP_Error on failure.
    2424 */
  • trunk/src/wp-admin/includes/import.php

    r47227 r49936  
    5050 * @param string   $description Importer description.
    5151 * @param callable $callback    Callback to run.
    52  * @return WP_Error Returns WP_Error when $callback is WP_Error.
     52 * @return void|WP_Error Void on success. WP_Error when $callback is WP_Error.
    5353 */
    5454function register_importer( $id, $name, $description, $callback ) {
  • trunk/src/wp-admin/includes/ms.php

    r49929 r49936  
    690690 * @global string $pagenow
    691691 *
    692  * @return false False if the current user is not a super admin.
     692 * @return void|false Void on success. False if the current user is not a super admin.
    693693 */
    694694function site_admin_notice() {
  • trunk/src/wp-admin/includes/network.php

    r49607 r49936  
    108108 * @global bool $is_apache
    109109 *
    110  * @param WP_Error $errors
     110 * @param false|WP_Error $errors Optional. Error object. Default false.
    111111 */
    112112function network_step1( $errors = false ) {
     
    385385 * @global bool $is_nginx Whether the server software is Nginx or something else.
    386386 *
    387  * @param WP_Error $errors
     387 * @param false|WP_Error $errors Optional. Error object. Default false.
    388388 */
    389389function network_step2( $errors = false ) {
  • trunk/src/wp-admin/includes/plugin.php

    r49927 r49936  
    12321232 *
    12331233 * @param string $plugin Path to the plugin file relative to the plugins directory.
    1234  * @return true True if a plugin's uninstall.php file has been found and included.
     1234 * @return true|void True if a plugin's uninstall.php file has been found and included.
     1235 *                   Void otherwise.
    12351236 */
    12361237function uninstall_plugin( $plugin ) {
  • trunk/src/wp-admin/includes/post.php

    r49927 r49936  
    814814 * @global WP_User $current_user
    815815 *
    816  * @return int|WP_Error
     816 * @return int|WP_Error Post ID on success, WP_Error on failure.
    817817 */
    818818function wp_write_post() {
     
    890890 * @since 2.0.0
    891891 *
    892  * @return int|null
     892 * @return int|void Post ID on success, void on failure.
    893893 */
    894894function write_post() {
  • trunk/src/wp-admin/includes/template.php

    r49384 r49936  
    2626 * @see wp_terms_checklist()
    2727 *
    28  * @param int    $post_id              Optional. Post to generate a categories checklist for. Default 0.
    29  *                                     $selected_cats must not be an array. Default 0.
    30  * @param int    $descendants_and_self Optional. ID of the category to output along with its descendants.
    31  *                                     Default 0.
    32  * @param int[]  $selected_cats        Optional. Array of category IDs to mark as checked. Default false.
    33  * @param int[]  $popular_cats         Optional. Array of category IDs to receive the "popular-category" class.
    34  *                                     Default false.
    35  * @param Walker $walker               Optional. Walker object to use to build the output.
    36  *                                     Default is a Walker_Category_Checklist instance.
    37  * @param bool   $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to
    38  *                                     the top of the list. Default true.
     28 * @param int         $post_id              Optional. Post to generate a categories checklist for. Default 0.
     29 *                                          $selected_cats must not be an array. Default 0.
     30 * @param int         $descendants_and_self Optional. ID of the category to output along with its descendants.
     31 *                                          Default 0.
     32 * @param int[]|false $selected_cats        Optional. Array of category IDs to mark as checked. Default false.
     33 * @param int[]|false $popular_cats         Optional. Array of category IDs to receive the "popular-category" class.
     34 *                                          Default false.
     35 * @param Walker      $walker               Optional. Walker object to use to build the output.
     36 *                                          Default is a Walker_Category_Checklist instance.
     37 * @param bool        $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to
     38 *                                          the top of the list. Default true.
    3939 */
    4040function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
  • trunk/src/wp-includes/capabilities.php

    r49802 r49936  
    873873 * @since 3.0.0
    874874 *
    875  * @param int $user_id (Optional) The ID of a user. Defaults to the current user.
    876  * @return bool True if the user is a site admin.
     875 * @param int|false $user_id Optional. The ID of a user. Defaults to false, to check the current user.
     876 * @return bool Whether the user is a site admin.
    877877 */
    878878function is_super_admin( $user_id = false ) {
  • trunk/src/wp-includes/comment-template.php

    r49735 r49936  
    879879 * @since 5.4.0 The `$deprecated` parameter was changed to `$post_id`.
    880880 *
    881  * @param string      $zero       Optional. Text for no comments. Default false.
    882  * @param string      $one        Optional. Text for one comment. Default false.
    883  * @param string      $more       Optional. Text for more than one comment. Default false.
    884  * @param int|WP_Post $post_id    Optional. Post ID or WP_Post object. Default is the global `$post`.
     881 * @param string|false $zero    Optional. Text for no comments. Default false.
     882 * @param string|false $one     Optional. Text for one comment. Default false.
     883 * @param string|false $more    Optional. Text for more than one comment. Default false.
     884 * @param int|WP_Post  $post_id Optional. Post ID or WP_Post object. Default is the global `$post`.
    885885 */
    886886function comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) {
     
    11091109 * @since 0.71
    11101110 *
    1111  * @param string $commenttxt   Optional. String to display for comment type. Default false.
    1112  * @param string $trackbacktxt Optional. String to display for trackback type. Default false.
    1113  * @param string $pingbacktxt  Optional. String to display for pingback type. Default false.
     1111 * @param string|false $commenttxt   Optional. String to display for comment type. Default false.
     1112 * @param string|false $trackbacktxt Optional. String to display for trackback type. Default false.
     1113 * @param string|false $pingbacktxt  Optional. String to display for pingback type. Default false.
    11141114 */
    11151115function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) {
     
    12001200 * @since 0.71
    12011201 *
    1202  * @param int $deprecated Not used (Was $timezone = 0).
     1202 * @param int|string $deprecated Not used (Was $timezone = 0).
    12031203 */
    12041204function trackback_rdf( $deprecated = '' ) {
     
    19811981 * @global WP_Comment $comment Global comment object.
    19821982 *
    1983  * @param string $no_reply_text  Optional. Text to display when not replying to a comment.
    1984  *                               Default false.
    1985  * @param string $reply_text     Optional. Text to display when replying to a comment.
    1986  *                               Default false. Accepts "%s" for the author of the comment
    1987  *                               being replied to.
    1988  * @param string $link_to_parent Optional. Boolean to control making the author's name a link
    1989  *                               to their comment. Default true.
     1983 * @param string|false $no_reply_text  Optional. Text to display when not replying to a comment.
     1984 *                                     Default false.
     1985 * @param string|false $reply_text     Optional. Text to display when replying to a comment.
     1986 *                                     Default false. Accepts "%s" for the author of the comment
     1987 *                                     being replied to.
     1988 * @param bool        $link_to_parent Optional. Boolean to control making the author's name a link
     1989 *                                     to their comment. Default true.
    19901990 */
    19911991function comment_form_title( $no_reply_text = false, $reply_text = false, $link_to_parent = true ) {
  • trunk/src/wp-includes/comment.php

    r49934 r49936  
    27172717 *
    27182718 * @param string $url        URL to ping.
    2719  * @param int    $deprecated Not Used.
     2719 * @param string $deprecated Not Used.
    27202720 * @return string|false String containing URI on success, false on failure.
    27212721 */
  • trunk/src/wp-includes/embed.php

    r49698 r49936  
    100100 *
    101101 * @param string $url  The URL that should be embedded.
    102  * @param array  $args {
     102 * @param array|string $args {
    103103 *     Optional. Additional arguments for retrieving embed HTML. Default empty.
    104104 *
  • trunk/src/wp-includes/l10n.php

    r49859 r49936  
    935935 * @since 4.6.0 The function now tries to load the .mo file from the languages directory first.
    936936 *
    937  * @param string $domain Text domain. Unique identifier for retrieving translated strings.
    938  * @param string $path   Optional. Path to the directory containing the .mo file.
    939  *                       Default false.
     937 * @param string       $domain Text domain. Unique identifier for retrieving translated strings.
     938 * @param string|false $path   Optional. Path to the directory containing the .mo file.
     939 *                             Default false.
    940940 * @return bool True when textdomain is successfully loaded, false otherwise.
    941941 */
     
    975975 * @since 2.9.0
    976976 *
    977  * @param string $domain Text domain. Unique identifier for retrieving translated strings.
    978  * @param string $path   Optional. Path to the directory containing the .mo file.
    979  *                       Default false.
     977 * @param string       $domain Text domain. Unique identifier for retrieving translated strings.
     978 * @param string|false $path   Optional. Path to the directory containing the .mo file.
     979 *                             Default false.
    980980 * @return bool True when the theme textdomain is successfully loaded, false otherwise.
    981981 */
  • trunk/src/wp-includes/media.php

    r49927 r49936  
    33633363 * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
    33643364 *                           of width and height values in pixels (in that order). Default 'thumbnail'.
    3365  * @param string      $text Optional. Link text. Default false.
     3365 * @param string|false $text Optional. Link text. Default false.
    33663366 */
    33673367function previous_image_link( $size = 'thumbnail', $text = false ) {
     
    33783378 * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
    33793379 *                           of width and height values in pixels (in that order). Default 'thumbnail'.
    3380  * @param string      $text Optional. Link text. Default false.
     3380 * @param string|false $text Optional. Link text. Default false.
    33813381 */
    33823382function next_image_link( $size = 'thumbnail', $text = false ) {
  • trunk/src/wp-includes/ms-functions.php

    r49927 r49936  
    22992299 * @since MU (3.0.0)
    23002300 *
    2301  * @param array $details {
     2301 * @param array|false $details {
    23022302 *     User details. Must at least contain values for the keys listed below.
    23032303 *
  • trunk/src/wp-includes/option.php

    r49600 r49936  
    10591059 * @since 2.7.0
    10601060 *
    1061  * @param string $name    The name of the setting.
    1062  * @param string $default Optional default value to return when $name is not set.
     1061 * @param string       $name    The name of the setting.
     1062 * @param string|false $default Optional. Default value to return when $name is not set. Default false.
    10631063 * @return mixed The last saved user setting or the default value/false if it doesn't exist.
    10641064 */
  • trunk/src/wp-includes/post.php

    r49929 r49936  
    58445844 *
    58455845 * @param string|array $args             Arguments for inserting an attachment.
    5846  * @param string      $file             Optional. Filename.
     5846 * @param string|false $file             Optional. Filename.
    58475847 * @param int          $parent           Optional. Parent post ID.
    58485848 * @param bool         $wp_error         Optional. Whether to return a WP_Error on failure. Default false.
     
    74167416 *
    74177417 * @param string $post_name Slug.
    7418  * @param string $post_ID   Optional. Post ID that should be ignored. Default 0.
     7418 * @param int    $post_ID   Optional. Post ID that should be ignored. Default 0.
    74197419 */
    74207420function wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.