Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 10 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 10 months ago.
Added patch

Download all attachments as: .zip

Change History (3)

@upadalavipul
10 months ago

Added patch

#1 @TobiasBg
10 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
10 months ago

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

Duplicate of #59185.

Hi there, thanks for the patch!

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

Version 0, edited 10 months ago by SergeyBiryukov (next)
Note: See TracTickets for help on using tickets.