Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#62984 new defect (bug)

Find some "global variables" are missing to define into the WordPress core files.

Reported by: viralsampat's profile viralsampat Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description

Hello team,

I have checked WordPress core file and I have found this "Overriding WordPress globals is prohibited." errors into the few files.

Also, I have found that some variables need to define globally into the few core files.

Here, I have mentioned few files list:

/src/wp-admin/menu-header.php
/src/wp-admin/menu.php
/src/wp-includes/shortcodes.php
/src/wp-includes/version.php

Thanks,

Attachments (1)

62984.patch (2.1 KB) - added by viralsampat 2 months ago.
I have checked above mentioned issue and I have resolved it and added patch.

Download all attachments as: .zip

Change History (5)

@viralsampat
2 months ago

I have checked above mentioned issue and I have resolved it and added patch.

#1 @mukesh27
2 months ago

  • Keywords needs-refresh added; dev-feedback needs-testing removed
  • Version trunk deleted

@viralsampat Your attached 62984.patch patch shows wrong version 6.2-alpha-54642-src

#2 @audrasjb
2 months ago

I concur, the patch doesn't apply to current trunk branch.

#3 @johnbillion
2 months ago

The variables in version.php are not always globals, the documentation is somewhat misleading. They're global when version.php is included in the global scope, but it also gets included in local scope during the upgrade process.

Explicitly declaring version.php variables as global will break updates. If someone wants to open a PR with this change, fingers crossed it gets picked up by tests. If not, the tests need improving.

This ticket was mentioned in PR #8356 on WordPress/wordpress-develop by @sukhendu2002.


2 months ago
#4

  • Keywords has-patch added; needs-refresh removed
Note: See TracTickets for help on using tickets.