Make WordPress Core

Opened 2 years ago

Closed 21 months ago

Last modified 12 months ago

#57069 closed task (blessed) (fixed)

Document the globals in various docblocks.

Reported by: upadalavipul's profile upadalavipul Owned by: audrasjb's profile audrasjb
Milestone: 6.2 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

function commenting details needs to improve.

File Names:
wp-includes/class-wp-block.php
wp-includes/class-wp-tax-query.php
wp-includes/class-wp-term-query.php
wp-includes/class-wp-locale.php

Function Name: render(), transform_query(), parse_orderby() and init()

Attachments (19)

57069.patch (1.9 KB) - added by upadalavipul 2 years ago.
57069.2.patch (2.5 KB) - added by jigar bhanushali 2 years ago.
57069.3.patch (974 bytes) - added by upadalavipul 2 years ago.
57069.4.patch (1.5 KB) - added by upadalavipul 2 years ago.
57069.5.patch (2.2 KB) - added by upadalavipul 2 years ago.
57069.6.patch (2.7 KB) - added by upadalavipul 2 years ago.
57069.7.patch (1.7 KB) - added by upadalavipul 2 years ago.
57069.8.patch (2.9 KB) - added by upadalavipul 2 years ago.
57069.9.patch (2.8 KB) - added by upadalavipul 2 years ago.
57069.diff (1.5 KB) - added by viralsampat 2 years ago.
I have found one another file and added comments for the same.
57069.2.diff (758 bytes) - added by viralsampat 2 years ago.
I have checked another file and added comments.
57069.10.patch (3.5 KB) - added by upadalavipul 2 years ago.
Added one more patch
57069.3.diff (1.2 KB) - added by viralsampat 2 years ago.
I have added another patch
57069.4.diff (1.6 KB) - added by viralsampat 2 years ago.
I have checked from my end and found few other files. So, I have added my patch.
57069.11.patch (1.6 KB) - added by upadalavipul 23 months ago.
57069.12.patch (2.6 KB) - added by upadalavipul 23 months ago.
57069.5.diff (2.7 KB) - added by viralsampat 22 months ago.
I have read your comments and made small changes based on requirement.
57069.6.diff (2.7 KB) - added by viralsampat 22 months ago.
I have added patch and resolved this issue.
57069.7.diff (2.6 KB) - added by costdev 21 months ago.
Globals reordered to meet the established docblock format + type added for $wp_customize

Download all attachments as: .zip

Change History (44)

@upadalavipul
2 years ago

#1 @mukesh27
2 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 6.2
  • Version trunk deleted

Thanks for the ticket and patch!

patch 57069.patch look fine to me. It removes unnecessary global declaration.

Ping @audrasjb for final review and commit.

#2 @mukesh27
2 years ago

  • Owner set to audrasjb
  • Status changed from new to assigned

#3 @audrasjb
2 years ago

  • Summary changed from Document the globals in the below description files functions. to Document the globals in various docblocks.
  • Type changed from defect (bug) to task (blessed)

Hello and thanks for the ticket!

We had the exact same ticket yesterday with #57058, this time let's use this ticket to address more occurrences of the same issue :)

Feel free to add more patches to this ticket if you find more missing or erroneous globals.

Thanks!

#4 @krupalpanchal
2 years ago

Hi @upadalavipul

I've found one more file you could update on patch.

  1. /wp-admin/includes/class-wp-upgrader.php - L910
Last edited 2 years ago by krupalpanchal (previous) (diff)

#5 @audrasjb
2 years ago

  • Keywords commit removed

[54867] merges the code proposed in 57069.patch, 57069.2.patch and 57069.4.patch.

#6 @audrasjb
2 years ago

In 54868:

Docs: Improve various globals documentation, as per documentation standards.

Props upadalavipul.
See #57069, #56792.

#7 @audrasjb
2 years ago

and [54868] merges the code proposed in 57069.3.patch.

#8 @audrasjb
2 years ago

I'll commit 57069.5.patch.
I'm unsure about 57069.6.patch as those are deprecated functions.

#9 @audrasjb
2 years ago

In 54877:

Docs: Improve various globals documentation, as per documentation standards.

Props upadalavipul.
See #57069, #56792.

#10 @audrasjb
2 years ago

[54877] merges the code proposed in 57069.5.patch.

@viralsampat
2 years ago

I have found one another file and added comments for the same.

@viralsampat
2 years ago

I have checked another file and added comments.

#11 @audrasjb
2 years ago

In 54953:

Docs: Improve various globals documentation, as per documentation standards.

Props upadalavipul.
See #57069, #56792.

#12 @audrasjb
2 years ago

[54953] addresses 57069.7.patch and 57069.8.patch.

#13 @SergeyBiryukov
2 years ago

In 54954:

Docs: Add missing type for $_wp_theme_features in WP_Debug_Data::debug_data().

Includes moving the global declaration to the top of the method for consistency.

Follow-up to [44986], [54953].

See #57069, #56792.

#14 @audrasjb
2 years ago

@viralsampat it looks like 57069.diff adds some unrelated changes:

// Check array attributes place holder value isset or not
if( empty( $attributes['placeholder'] ) ) {
    $attributes['placeholder'] = 'Optional placeholder…';
}

(also, this change doesn't follow WPCS)

Edit: same goes for 57069.2.diff, this patch is unrelated.

Last edited 2 years ago by audrasjb (previous) (diff)

#15 @viralsampat
2 years ago

HELLO @audrasjb

Thank you so much for sharing your feedback.

By mistake I had created patch with old changes.

Can I will create new patch and can I add it back?

Please let me know your feedback for the same.

Thanks,

@upadalavipul
2 years ago

Added one more patch

#16 @audrasjb
2 years ago

@upadalavipul I'm going to partially commit 57069.9.patch. Worth noting that I made a few changes from your original patch:

  • twentytwenty/inc/template-tags.php: I moved the first declaration to line 244.
  • wp-includes/blocks/comments.php: this needs to be addressed on Gutenberg side. Please open a PR on the GH repository.

#17 @audrasjb
2 years ago

In 55003:

Docs: Improve various globals documentation, as per docblock standards.

Props upadalavipul, audrasjb.

See #57069, #56792.

#18 @SergeyBiryukov
2 years ago

In 55004:

Twenty Seventeen: Document the $twentyseventeencounter global.

Follow-up to [38833], [38986], [55003].

See #57069, #56792.

@viralsampat
2 years ago

I have added another patch

@viralsampat
2 years ago

I have checked from my end and found few other files. So, I have added my patch.

#19 @audrasjb
22 months ago

@viralsampat for 57069.3.diff and 57069.4.diff, it would be nice to add a small description for the globals.

@upadalavipul 57069.11.diff contains unrelated changes and we can't commit 57069.12.diff as these files are located in the Block Editor and should be modified on Gutenberg GitHub repository.

@viralsampat
22 months ago

I have read your comments and made small changes based on requirement.

@viralsampat
22 months ago

I have added patch and resolved this issue.

This ticket was mentioned in Slack in #core by costdev. View the logs.


21 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


21 months ago

@costdev
21 months ago

Globals reordered to meet the established docblock format + type added for $wp_customize

#22 @costdev
21 months ago

@audrasjb I've added 57069.7.diff to bring it in line with docblock formatting standards and to add a type for $wp_customize. Do you have time to take a look at this one? 🙂

#23 @audrasjb
21 months ago

In 55472:

Bundled Themes: Improve various globals documentation, as per docblock standards.

Props viralsampat, audrasjb, costdev.
See #56792, #57069.

#24 @audrasjb
21 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

We're very close to WP 6.2 RC1 now. Closing this as fixed.
Fixes for 6.3 can go to #57840.

#25 @SergeyBiryukov
12 months ago

#60019 was marked as a duplicate.

Note: See TracTickets for help on using tickets.