Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#44932 closed defect (bug) (fixed)

use $wp_version instead of $GLOBALS['wp_version']

Reported by: jaydeep-rami's profile Jaydeep Rami Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description

I found that in Core we have declared @global $wp_option parameter in PHPDoc but not used it in the function. Instead of that used $GLOBALS['wp_version'].

It's correct but better to use $wp_version.

https://develop.svn.wordpress.org/trunk/src/wp-includes/default-constants.php

Attachments (3)

44932.patch (947 bytes) - added by Jaydeep Rami 6 years ago.
Fix: Ticket #44932
44932.2.patch (959 bytes) - added by Jaydeep Rami 6 years ago.
Fix: Ticket #44932 create with src/ path
44932.3.patch (961 bytes) - added by sabernhardt 4 years ago.
refreshed patch

Download all attachments as: .zip

Change History (11)

@Jaydeep Rami
6 years ago

Fix: Ticket #44932

#1 @Jaydeep Rami
6 years ago

  • Keywords has-patch added; needs-patch removed

@Jaydeep Rami
6 years ago

Fix: Ticket #44932 create with src/ path

#2 @Jaydeep Rami
6 years ago

  • Focuses coding-standards added; docs removed

#3 @mukesh27
6 years ago

  • Keywords has-screenshots added

#4 @mukesh27
6 years ago

  • Keywords has-screenshots removed

#5 @pento
6 years ago

  • Version trunk deleted

@sabernhardt
4 years ago

refreshed patch

#6 @sabernhardt
4 years ago

Thanks @jaydeep-rami!

Your patch 44932.2.patch applies, but I updated it in 44932.3.patch to keep the spaces added in changeset:45203.

#7 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from assigned to reviewing

#8 @SergeyBiryukov
4 years ago

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

In 48971:

Coding Standards: Explicitly declare the $wp_version global used in some core files.

Props jaydeep-rami, sabernhardt.
Fixes #44932.

Note: See TracTickets for help on using tickets.