#48303 closed task (blessed) (fixed)
Docblock improvements for 5.4
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | docs | Cc: |
Commits (85)
- [46591] Docs: Improve formatting of various
WP_Screen
DocBlocks.… by @SergeyBiryukov 5 months ago - [46594] Docs: Miscellaneous docblock fixes and improvements.… by @johnbillion 5 months ago
- [46595] Docs: Switch to typed array notation for the docs for asset dependency functions.… by @johnbillion 5 months ago
- [46596] Docs: Switch more docs over to typed array notation, plus some fixes.… by @johnbillion 5 months ago
- [46597] Docs: Update the docs for the error parameter that gets passed around during filesystem credential collection.… by @johnbillion 5 months ago
- [46598] Docs: Add missing docs for the
auth_cookie_bad_session_token
action.… by @johnbillion 5 months ago - [46599] Docs: Correct and improve inline docs for the file type functions.… by @johnbillion 5 months ago
- [46600] Docs: Improve DocBlock formatting in
WP_Block_Styles_Registry
per the documentation standards.… by @SergeyBiryukov 5 months ago - [46603] Docs: Correct invalid hook docblocks.… by @johnbillion 5 months ago
- [46604] Docs: Correct invalid hook docblock placement.… by @johnbillion 5 months ago
- [46607] Docs: Restore correct placement for duplicate hook reference in
render_block_core_latest_comments()
.… by @SergeyBiryukov 5 months ago - [46608] Docs: Remove some funky nested filters.… by @johnbillion 5 months ago
- [46609] Docs: Coding standards fix after [46608].… by @johnbillion 5 months ago
- [46610] Docs: Miscellaneous docblock corrections.… by @johnbillion 5 months ago
- [46623] Docs: Correct some incorrect docblock tags.… by @johnbillion 5 months ago
- [46624] Docs: Correct some more invalid inline docs.… by @johnbillion 5 months ago
- [46630] Docs: Correct
@see
references for PHP 4 constructors inwp-includes/class-json.php
.… by @SergeyBiryukov 5 months ago - [46644] Docs: Fix some incorrect return tags in docblocks.… by @johnbillion 5 months ago
- [46647] Docs: Correct some array hash notations added in [46644].… by @SergeyBiryukov 5 months ago
- [46652] Docs: Correct and improve the readability of some parameters of
WP_Term_Query
.… by @johnbillion 5 months ago - [46660] Docs: Improve documentation of known return types, plus other docs fixes.… by @johnbillion 5 months ago
- [46661] Docs: Further improve documentation of known return types, plus other docs fixes.… by @johnbillion 5 months ago
- [46662] Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.… by @johnbillion 5 months ago
- [46691] Docs: Move the
@link
tag for Customize API inWP_Customize_Manager::add_setting()
andWP_Customize_Setting
to a more appropriate place.… by @SergeyBiryukov 5 months ago - [46695] Docs: Miscellaneous docblock corrections in
wp-admin/includes/plugin.php
.… by @SergeyBiryukov 5 months ago - [46696] Docs: In various
@return
tags, list the expected type first, instead ofWP_Error
.… by @SergeyBiryukov 5 months ago - [46729] Docs: Correct some invalid hook docblocks.… by @johnbillion 5 months ago
- [46760] Docs: Adjust
wp_is_json_request()
andwp_is_xml_request()
return value descriptions for consistency.… by @SergeyBiryukov 4 months ago - [46800] Docs: Replace
@returns
tags in JS docs with@return
.… by @SergeyBiryukov 4 months ago - [46801] Docs: Correct
@param
type for the function parameter intests_add_filter()
and_test_filter_build_unique_id()
.… by @SergeyBiryukov 4 months ago - [46821] Docs: Correct various docblocks documentation.… by @johnbillion 4 months ago
- [46823] Docs: Increase the specificity of various docblock parameter types and return types.… by @johnbillion 4 months ago
- [46826] Docs: Further docblock corrections and improvements.… by @johnbillion 4 months ago
- [46827] Bundled Themes: Correct
@since
tags to refer to the theme version instead of WordPress version.… by @SergeyBiryukov 4 months ago - [46828] Twenty Twenty: Use duplicate hook references for
page_css_class
andpage_menu_link_attributes
filters inTwentyTwenty_Walker_Page
.… by @SergeyBiryukov 4 months ago - [46837] Docs: Correct DocBlock formatting for
admin_email_confirm
andadmin_email_confirm_form
hooks.… by @SergeyBiryukov 4 months ago - [46882] Tests: Docs: Correct
@param
formatting inSpeedTrapListener
after [35226] and [45607].… by @SergeyBiryukov 4 months ago - [46985] Docs: Various documentation fixes for unit test factories.… by @SergeyBiryukov 3 months ago
- [46986] Docs: Add
@method
notation forWP_UnitTest_Factory_For_Term::create_and_get()
for consistency with other factories.… by @SergeyBiryukov 3 months ago - [46987] Docs: Improve comments in
tests/formatting/redirect.php
per the documentation standards.… by @SergeyBiryukov 3 months ago - [47009] Docs: Use a third-person singular verb for comment template function descriptions, per the documentation standards.… by @SergeyBiryukov 3 months ago
- [47017] Docs: Improve
@return
description forwp_update_comment()
andWP_UnitTest_Factory_For_Comment::update_object()
.… by @SergeyBiryukov 3 months ago - [47022] Docs: Add missing
@since
tags forwp-includes/class-wp-editor.php
.… by @SergeyBiryukov 3 months ago - [47032] Docs: Synchronize "Default empty array" notes for
$args
parameter inget_comment_text()
andcomment_text()
.… by @SergeyBiryukov 3 months ago - [47042] Docs: Remove duplicate inline comment in
wp_mail()
.… by @ocean90 3 months ago - [47049] Docs: Indicate that
load_script_textdomain_relative_path
filter value can befalse
.… by @SergeyBiryukov 3 months ago - [47052] Docs: Correct alphabetic order of parameters in
WP_Query::parse_query()
DocBlock.… by @SergeyBiryukov 3 months ago - [47055] Docs: Remove
@return void
from widget DocBlocks.… by @SergeyBiryukov 3 months ago - [47059] Docs: Synchronize
@return
descriptions for::handle_row_actions()
methods in list tables.… by @SergeyBiryukov 3 months ago - [47060] Docs: In various
@return
tags, list the expected type first, instead offalse
.… by @SergeyBiryukov 3 months ago - [47065] Docs: Improve documentation for
wp_save_image_file()
and related functions.… by @SergeyBiryukov 2 months ago - [47088] Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.… by @SergeyBiryukov 2 months ago
- [47096] Docs: Correct DocBlock formatting for filters accepting the
$parsed_args
parameter.… by @SergeyBiryukov 2 months ago - [47097] Docs: Expand
@return
value description forwp_nav_menu()
.… by @SergeyBiryukov 2 months ago - [47099] Docs: Correct
@return
value forupdate_core()
andCore_Upgrader::upgrade()
.… by @SergeyBiryukov 2 months ago - [47100] Docs: Adjust
@return
value ofparent_dropdown()
for consistency with other dropdown functions.… by @SergeyBiryukov 2 months ago - [47101] Docs: Adjust documentation for some
pre_*
filters for consistency.… by @SergeyBiryukov 2 months ago - [47102] Docs: Correct
@return
value forparent_dropdown()
.… by @SergeyBiryukov 2 months ago - [47103] Docs: Expand
@return
description forthe_terms()
.… by @SergeyBiryukov 2 months ago - [47104] Docs: Expand
@return
value description forwp_loginout()
,wp_register()
,get_calendar()
.… by @SergeyBiryukov 2 months ago - [47109] Docs: Improve documentation for
add_user_to_blog()
,add_existing_user_to_blog()
, andadd_new_user_to_blog()
.… by @SergeyBiryukov 2 months ago - [47121] Docs: Improve DocBlocks in
phpunit/includes/object-cache.php
per the documentation standards.… by @SergeyBiryukov 2 months ago - [47122] Docs: Improve inline comments per the documentation standards.… by @SergeyBiryukov 2 months ago
- [47157] Docs: Correct DocBlock formatting for
register_setting()
.… by @SergeyBiryukov 8 weeks ago - [47159] Docs: Improve inline comments in
wp-admin/options.php
per the documentation standards.… by @SergeyBiryukov 8 weeks ago - [47165] Docs: Fix typo in a comment with
WP_DEBUG_DISPLAY
description.… by @SergeyBiryukov 8 weeks ago - [47170] Docs: Improve documentation for
WP_Dependencies
,WP_Scripts
, andWP_Styles
methods.… by @SergeyBiryukov 8 weeks ago - [47174] Docs: Improve description for
add_user_to_blog()
andremove_user_from_blog()
parameters.… by @SergeyBiryukov 7 weeks ago - [47189] Docs: Correct type for
$item
and $argsparameters in
Walker_Nav_Menu_Checklistand
Walker_Nav_Menu_Editto match the parent
Walker_Nav_Menu` class.… by @SergeyBiryukov 7 weeks ago - [47230] Docs: Add descriptions for some globals:… by @SergeyBiryukov 7 weeks ago
- [47295] Docs: Improve inline comments for
require_once()
calls inWP_REST_Attachments_Controller
.… by @SergeyBiryukov 6 weeks ago - [47297] Docs: Fix typo in a comment in
WP_REST_Attachments_Controller::create_item()
.… by @SergeyBiryukov 6 weeks ago - [47298] Docs: Improve inline comments for
require_once
calls inWP_REST_Users_Controller
per the documentation standards.… by @SergeyBiryukov 6 weeks ago - [47347] Docs: Use third-person singular verbs for function descriptions in
wp-includes/option.php
, per the documentation standards.… by @SergeyBiryukov 5 weeks ago - [47383] Docs: Use a consistent description for the
$manager
parameter in various Customizer class constructions.… by @SergeyBiryukov 4 weeks ago - [47394] Docs: Correct and improve the docs for some media related functions.… by @johnbillion 4 weeks ago
- [47396] Docs: Correct the parameter documentation of the
request_filesystem_credentials
filter.… by @johnbillion 4 weeks ago - [47397] Docs: Use more specific types in parameter descriptions in place of
mixed
.… by @johnbillion 4 weeks ago - [47398] Docs: Miscellaneous docs fixes and improvements.… by @johnbillion 4 weeks ago
- [47399] Docs: Use more specific type in description for
_WP_Dependency::$deps
.… by @SergeyBiryukov 4 weeks ago - [47400] Docs: Use more specific type in parameter description for
wp_unslash()
.… by @SergeyBiryukov 4 weeks ago - [47401] Docs: Synchronize parameter descriptions for conditional tags with their
WP_Query
counterpart methods.… by @SergeyBiryukov 4 weeks ago - [47402] Docs: Use more specific type in parameter descriptions for
is_page()
,is_single()
,is_singular()
, and theirWP_Query
counterpart methods.… by @SergeyBiryukov 4 weeks ago - [47502] Docs: Revert a type change for the
$value
parameter ofWP_Dependencies::add_data()
in [47170].… by @SergeyBiryukov 3 days ago - [47503] Docs: Revert a type change for the
$value
parameter ofWP_Dependencies::add_data()
in [47170].… by @SergeyBiryukov 3 days ago
Pull Requests
- Loading…
Change History (112)
#2
@
5 months ago
wp_enqueue_script
, wp_enqueue_style
, wp_register_script
and wp_register_style
parameter $deps
could be narrowed from array
to string[]
.
#3
@
5 months ago
wp_unslash
parameter and return value could be narrowed from string|array
to string|string[]
.
This ticket was mentioned in Slack in #docs by atachibana. View the logs.
5 months ago
@
5 months ago
Docs: Moved the @link tag for Customize API in WP_Customize_Manager::add_setting() and WP_Customize_Setting
#33
in reply to:
↑ 26
;
follow-up:
↓ 34
@ Core Committer
5 months ago
Replying to Marcio Zebedeu:
Can you please confirm? I had my doubts about naming patch.
Thanks for the patches! However, [46647] and [46691] are changesets, not tasks. These are changes that are already committed and generally don't require additional patches, unless you notice a typo or any other inaccuracy :)
#34
in reply to:
↑ 33
@
5 months ago
Replying to SergeyBiryukov:
Replying to Marcio Zebedeu:
Can you please confirm? I had my doubts about naming patch.
Thanks for the patches! However, [46647] and [46691] are changesets, not tasks. These are changes that are already committed and generally don't require additional patches, unless you notice a typo or any other inaccuracy :)
Oh...thank. I'm still learning :)
#71
@
2 months ago
Hi, I started by looking at the function get_the_post_thumbnail
and its parameter $size
, which is currently of the type string|array
. I think this could be narrowed down to string|int[]
by examining its source and all the functions and hooks it calls. As such, I think these functions and hooks could have their parameter $size
narrowed in the same way. The ones I encountered:
Functions:
get_the_post_thumbnail
wp_get_attachment_image
wp_get_attachment_image_src
image_downsize
image_get_intermediate_size
image_constrain_size_for_editor
Hooks:
begin_fetch_post_thumbnail_html
end_fetch_post_thumbnail_html
wp_get_attachment_image_src
image_downsize
image_get_intermediate_size
editor_max_image_size
However, I'm pretty sure there are more.
#73
@ Core Committer
2 months ago
@marekdedic Thanks for the comment, I think this is covered by #47364.
#74
@
2 months ago
Hi, OK, thanks.
6 more functions that can have parameters narrowed:
is_page
can have parameter narrowed toint|string|int[]|string[]
is_single
can have parameter narrowed toint|string|int[]|string[]
is_singular
can have parameter narrowed tostring|string[]
WP_Query::is_page
can have parameter narrowed toint|string|int[]|string[]
WP_Query::is_single
can have parameter narrowed toint|string|int[]|string[]
WP_Query::is_singular
can have parameter narrowed tostring|string[]
Partially covered by #48354
#97
in reply to:
↑ 89
@ Core Committer
4 weeks ago
Replying to johnbillion:
In 47394:
@johnbillion I can't seem to figure out when the first parameter of the image_downsize
filter can be an array. The filter is used in two places, and both pass false
as the first parameter. Was the change to bool|array
intentional?
wp_image_resize_identical_dimensions
uses a similar approach, and the first parameter is still documented as bool
there.
#98
follow-up:
↓ 99
@ Core Committer
4 weeks ago
@SergeyBiryukov It can be an array if another filter is filtering the value and returning an array intended as the short-circuited return value.
Good point though - Core is not consistent in documenting the types for these short-circuit filter parameters. Worth a separate ticket?
#99
in reply to:
↑ 98
@ Core Committer
3 weeks ago
- Resolution set to fixed
- Status changed from new to closed
Replying to johnbillion:
It can be an array if another filter is filtering the value and returning an array intended as the short-circuited return value.
Indeed, thanks! That could be clarified in the description though.
Good point though - Core is not consistent in documenting the types for these short-circuit filter parameters. Worth a separate ticket?
Probably :) With 5.4 RC1 approaching, let's close this one as fixed.
#101
follow-up:
↓ 103
@ Core Committer
11 days ago
@SergeyBiryukov Just saw the changes here and I'm getting static analysis warnings for code like:
<?php wp_scripts()->add_data( $handle, 'foo_script_attributes', [ 'async' => true, ] );
This change to WP_Dependencies::add_data()
in r47170 appears to not be correct:
- * @param mixed $value The data value. + * @param string $value The data value.
It has a mismatch with wp_script_add_data()
which still indicates the type of $value
as being mixed
.
#103
in reply to:
↑ 101
;
follow-up:
↓ 106
@ Core Committer
3 days ago
Replying to westonruter:
This change to
WP_Dependencies::add_data()
in r47170 appears to not be correct:
- * @param mixed $value The data value. + * @param string $value The data value.It has a mismatch with
wp_script_add_data()
which still indicates the type of$value
as beingmixed
.
Thanks for catching that! I guess I was confused by the fact that while the parameter indeed has a mixed
type, it's described as a string in several places:
- "Extra item data (string)" in
WP_Dependencies::get_data()
. - "String containing the data to be added" in
wp_script_add_data()
. - "String containing the CSS data to be added" in
wp_style_add_data()
.
Let's revert that change for now and clean up the inconsistencies later.
#105
@ Core Committer
3 days ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from reopened to closed
In 47503:
#106
in reply to:
↑ 103
@ Core Committer
3 days ago
Replying to SergeyBiryukov:
Let's revert that change for now and clean up the inconsistencies later.
Left a comment on #49572 as a follow-up: comment:4:ticket:49572.
I didn't know about this tracking ticket for all the small docs issues, so I created a lot of small ones (sorry...)