Opened 6 years ago
Closed 5 years ago
#46602 closed defect (bug) (fixed)
Remove documentation reference to global $wpdb in upgrade.php
Reported by: | jayupadhyay01 | Owned by: | dswebsme |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | docs | Cc: |
Description
I've found Some Code Changes Require about Variable Defining.
Attachments (2)
Change History (15)
#1
@
6 years ago
- Component changed from General to Upgrade/Install
- Keywords good-first-bug added
- Summary changed from Code Changes in upgrade.php from wp-admin to Add missing global variable $wpdb in upgrade.php
- Type changed from enhancement to defect (bug)
#3
@
6 years ago
Hi @SergeyBiryukov
As per your suggestion i have changed the document and Added another patch #46602(changes).diff, Please have a look and let me know if any further actions required?
This ticket was mentioned in Slack in #core by jayupadhyay01. View the logs.
5 years ago
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
5 years ago
#8
@
5 years ago
Tested and confirmed that the updated patch #46602(changes).diff
correctly addresses the issue by fixing the documentation. No functional code modified.
Ready for commit.
#9
@
5 years ago
- Summary changed from Add missing global variable $wpdb in upgrade.php to Remove documentation reference to global $wpdb in upgrade.php
#12
@
5 years ago
- Keywords has-dev-note removed
Removing has-dev-note
. This keyword should only be used for noting tickets that have had a developer note published to the Make WordPress Core website.
Hi @jayupadhyay01, welcome to WordPress Trac! Thanks for the patch.
$wpdb
is already available here viawp-load.php
.Per the documentation standards, the
@global
tag is meant to list PHP globals used within functions or methods.Looking at other files in
wp-admin
, it seems like we don't generally document$wpdb
in code that itself is in the global namespace. The standards don't say anything about it either.So perhaps we should remove
@global wpdb $wpdb
here instead. Introduced in [32642].@DrewAPicture, do you have an opinion on documenting globals outside of functions or methods?