Make WordPress Core

Opened 8 weeks ago

Closed 7 weeks ago

#63496 closed defect (bug) (fixed)

Document global variables comment code improvement.

Reported by: upadalavipul's profile upadalavipul Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: General Keywords: needs-refresh
Focuses: docs Cc:

Description

I have reviewed the below file code and found that we are using a global $wp_version variable. but they do not mention it in the function comment. Also one more $wp_theme_directories global variable used. but they do not mention in the function comment. So I think we need to improve the function comment code.

Files:


1) wp-admin/includes/update-core.php
2) wp-includes/theme.php

Attachments (3)

63496.patch (2.7 KB) - added by upadalavipul 8 weeks ago.
patch Added.
63496.2.patch (2.1 KB) - added by upadalavipul 8 weeks ago.
I have updated patch.
63496.3.patch (13.5 KB) - added by viralsampat 7 weeks ago.
I have reviewed above mentioned issue and founds few files. Here, I have added its patch.

Download all attachments as: .zip

Change History (12)

@upadalavipul
8 weeks ago

patch Added.

#1 @mukesh27
8 weeks ago

  • Keywords needs-refresh added
  • Version trunk deleted

Hi there!

Thanks for ticket and patch. The indention is not correct in wp-admin/includes/update-core.php that needs to correct.

@upadalavipul
8 weeks ago

I have updated patch.

#3 @SergeyBiryukov
7 weeks ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
7 weeks ago

In 60262:

Docs: Document the $wp_theme_directories global in wp_is_block_theme().

Follow-up to [52069], [52330].

Props upadalavipul.
See #63496.

#5 in reply to: ↑ 2 ; follow-up: @SergeyBiryukov
7 weeks ago

Replying to johnbillion:

$wp_version can't be globalised here. There's an inline comment about it

I think the patch aims to document the existing $GLOBALS['wp_version'] reference in line 1121.

#6 in reply to: ↑ 5 ; follow-up: @johnbillion
7 weeks ago

Replying to SergeyBiryukov:

I think the patch aims to document the existing $GLOBALS['wp_version'] reference in line 1121.

Seeing as that explicitly uses the $GLOBALS superglobal I would say it doesn't need documenting as a global.

#7 in reply to: ↑ 6 ; follow-up: @SergeyBiryukov
7 weeks ago

Replying to johnbillion:

Seeing as that explicitly uses the $GLOBALS superglobal I would say it doesn't need documenting as a global.

That would be inconsistent with the rest of core though, we do document these $GLOBALS references pretty much everywhere :)

@viralsampat
7 weeks ago

I have reviewed above mentioned issue and founds few files. Here, I have added its patch.

#8 in reply to: ↑ 7 @SergeyBiryukov
7 weeks ago

@viralsampat Thanks for the patch!

However, the alignment looks correct as is in all those files, except for class-ftp-*.php, but they a part of an adopted PemFTP library and don't follow the WordPress coding standards.

#9 @SergeyBiryukov
7 weeks ago

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

In 60265:

Docs: Document the $wp_version global in update_core().

Follow-up to [17576], [22226], [31124], [32643], [39687].

Props upadalavipul, mukesh27, johnbillion, SergeyBiryukov.
Fixes #63496.

Note: See TracTickets for help on using tickets.