Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#59349 closed defect (bug) (duplicate)

Remove the Unused global variables in the wp-includes folder.

Reported by: upadalavipul's profile upadalavipul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: coding-standards Cc:

Description

I have reviewed the code and found Unused global variables in one of the below files. Please check the below file:

File:

  1. wp-includes/template.php

Attachments (1)

59349.patch (1.4 KB) - added by upadalavipul 11 months ago.
Added patch

Download all attachments as: .zip

Change History (3)

@upadalavipul
11 months ago

Added patch

#1 @TobiasBg
11 months ago

  • Keywords close added

Thanks for opening this ticket! However, I believe that these globals are included on purpose, as the function docblock says:

The globals are set up for the template file to ensure that the WordPress
environment is available from within the function. The query variables are
also available.

So, the globals are then available to the require(_once)d files.

#2 @SergeyBiryukov
11 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, thanks for the patch!

As noted in comment:1 and previously in comment:5:ticket:59185, these globals should not be removed.

Closing as a duplicate of #59185.

Last edited 11 months ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.