#60021 closed task (blessed) (fixed)
Document global $link & $wpdb in wp-includes/bookmark.php & wp-includes/class-wp-user.php files.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | docs, coding-standards | Cc: |
Description
I have reviewed the below file code and found that we are using a global $link and $wpdb variable. but they do not mention it in the function comment. So I think we need to improve the function comment code.
Files:
- trunk/wp-includes/bookmark.php
- wp-includes/class-wp-user.php
Attachments (24)
Change History (56)
@
14 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
@
14 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
#2
@
14 months ago
- Focuses docs added
- Milestone changed from Awaiting Review to 6.5
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
@
14 months ago
Added Since before global & added global before param in documentation as per php coding standard in src/wp-includes/admin-bar.php
@
14 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
@
14 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
@
13 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
@
13 months ago
I have Added Global Documentation for Twenty Thirteen theme, Twenty Fourteen theme & Twenty Fifteen theme.
#16
@
13 months ago
I have added global documentation in below files.
/wp-includes/blocks/block.php
/wp-includes/blocks/calendar.php
/wp-includes/blocks/comments.php
@
13 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
#17
@
12 months ago
Some of the changes in these patches were probably skipped intentionally, but below is the status of each patch. It could help determine what still should be done toward 6.5 and what might belong on a separate ticket/issue.
60021.patch:
Completed in r57190 and r57191 (some changes from r57191 reverted in r57192).
60021.2.patch:
Mostly added in r57193, r57194, and r57196, but the $post
global is not documented in wp-includes/feed-atom-comments.php
or wp-includes/feed-rss2-comments.php
.
60021.3.patch:
Proposes documenting $table_prefix
global in wp-settings.php
, in the same docblock as $wpdb
.
60021.4.patch:
Completed in r57204 and r57216.
60021.5.patch:
Completed in r57223, r57225, and r57226.
60021.6.patch:
Proposes documenting $GLOBALS['_paused_plugins']
for three functions in wp-admin/includes/plugin.php
:
is_plugin_paused()
wp_get_plugin_error()
paused_plugins_notice()
60021.diff:
Proposes reordering existing documentation in wp-includes/admin-bar.php
. Grouping the two since
lines together before global
in wp_admin_bar_edit_site_menu()
would follow up on r56209; moving $wp_customize
global before the param
in wp_admin_bar_customize_menu()
would follow up on r38810.
60021.7.patch:
The getid3.lib.php change would need to be made upstream in that external library (earlier, I incorrectly said that getID3 was adopted). The two REST API files received $post
documentation in r57230.
60021.8.patch:
Proposes documenting $GLOBALS['_paused_themes']
for three functions in wp-admin/includes/theme.php
plus one in wp-includes/load.php
:
is_theme_paused()
wp_get_theme_error()
paused_themes_notice()
wp_skip_paused_themes()
60021.9.patch:
Proposes documenting $wp_embed
and $wp_plugin_paths
in wp-settings.php
as well as $GLOBALS['xmlrpc_logging']
in the deprecated function logIO()
(xmlrpc.php
).
60021.10.patch:
Proposes documenting $GLOBALS['_paused_plugins']
in wp_skip_paused_plugins()
(in wp-includes/load.php
).
60021.11.patch:
Completed in r57234 and r57370.
60021.12.patch:
Completed in r57193.
60021.13.patch:
Proposes documenting two variables in wp-settings.php
that are in other patches ($GLOBALS['table_prefix']
in 60021.3.patch and $GLOBALS['wp_plugin_paths']
in 60021.9.patch).
60021.14.patch:
The $link
global in bookmark.php
is already documented in r57191 (as an object, not a string). The $xmlrpc_logging
global documentation is also proposed in 60021.9.patch.
60021.15.patch:
Proposes documenting $wp_local_package
and $wp_locale
globals in wp-admin/setup-config.php
the way they are in wp-admin/install.php
. It also adds $table_prefix
in wp-settings.php
(compare with 60021.3.patch and 60021.13.patch).
60021.16.patch:
Proposes documenting the $_wp_tests_development_mode
global within the wp_get_development_mode()
docblock, though the variable has a comment about its use "exclusively for core tests."
60021.17.patch:
Bundled themes are on a separate ticket, #58715, and the pull request includes these items.
60021.18.patch and 60021.19.patch:
Changes need to be made upstream in the Gutenberg repository and then synced to files in the wp-includes/blocks
directory.
#18
@
12 months ago
I corrected my mistake in the last comment (getID3 is still an external library).
Below is a chart of the remaining variables to consider adding to docblocks.
Variables | Files | Patches |
---|---|---|
$table_prefix | wp-settings.php | 60021.3.patch, 60021.13.patch, 60021.15.patch |
$wp_embed | wp-settings.php | 60021.9.patch |
$wp_plugin_paths | wp-settings.php | 60021.9.patch, 60021.13.patch |
$xmlrpc_logging | xmlrpc.php | 60021.9.patch, 60021.14.patch |
$wp_local_package and$wp_locale | wp-admin/setup-config.php | 60021.15.patch |
$_paused_plugins | wp-admin/includes/plugin.php andwp-includes/load.php | 60021.6.patch and 60021.10.patch (together) |
$_paused_themes | wp-admin/includes/theme.php andwp-includes/load.php | 60021.8.patch |
$_wp_tests_development_mode | wp-includes/load.php | 60021.16.patch |
$post | wp-includes/feed-atom-comments.php andwp-includes/feed-rss2-comments.php | 60021.2.patch |
reordering only (not adding a variable) | wp-includes/admin-bar.php | 60021.diff |
#19
@
12 months ago
Thanks for the table, very helpful!
@SergeyBiryukov did you want to commit those in time for RC? Otherwise probably best to just open a new ticket for 6.6 to address the rest.
#23
@
11 months ago
I also checked history for xmlrpc.php
and setup-config.php
.
xmlrpc.php
- When [19935] deprecated both the
logIO()
function and$xmlrpc_logging
12 years ago, it specifically removed documentation for the global. - If it is still worth adding a
@global
tag within thelogIO()
docblock, the variable accepted multiple types:int|bool
(either0
,1
or their boolean equivalents). - For a possible
@since
tag, [1348] had added the variable (and the rest of the file) the day after a version bump in [1344]. This suggests the next version was 1.5.0, but I found it in the zipped packages for both 1.0-platinum and 1.2-mingus.
setup-config.php
- [51477] removed
@global
tags from thesetup_config_display_header()
docblock, where they did not belong. However, it did not put a docblock closer to those globals, as it is ininstall.php
(and in thesetup-config.php
part of 60021.15.patch). - [32642] added the documentation for
$wp_local_package
and$wp_locale
in install.php, and then [45737] and [47230] included the descriptions. - [29669] added the
$wp_locale
variable tosetup-config.php
, and [29705] added$wp_local_package
.
#30
@
11 months ago
- Resolution set to fixed
- Status changed from reviewing to closed
Thanks everyone! I think we're done here, let's create a new ticket for any remaining issues.
@
11 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
@
11 months ago
I have checked above mentioned issue and founds few files. Here, I have added its patch.
Thanks for the ticket and patch!
There are many other places in code that miss similar global declaration could you please ass all in single patch so we can easy commit it otherwise we get similar ticket for other places.
Make sure to update ticket title.