Make WordPress Core

Opened 8 years ago

Closed 6 years ago

#44932 closed defect (bug) (fixed)

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

Reported by: Jaydeep Rami Owned by: SergeyBiryukov
Priority: normal Milestone: 5.6
Component: General Version:
Severity: normal Keywords: has-patch
Cc: Focuses: coding-standards

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 8 years ago.
Fix: Ticket #44932
44932.2.patch​ (959 bytes ) - added by Jaydeep Rami 8 years ago.
Fix: Ticket #44932 create with src/ path
44932.3.patch​ (961 bytes ) - added by sabernhardt 6 years ago.
refreshed patch

Download all attachments as: .zip

Change History (11)

@Jaydeep Rami
8 years ago

Fix: Ticket #44932

#1 @Jaydeep Rami
8 years ago

  • Keywords has-patch added; needs-patch removed

@Jaydeep Rami
8 years ago

Fix: Ticket #44932 create with src/ path

#2 @Jaydeep Rami
8 years ago

  • Focuses coding-standards added; docs removed

#3 @mukesh27
8 years ago

  • Keywords has-screenshots added

#4 @mukesh27
8 years ago

  • Keywords has-screenshots removed

#5 @pento
8 years ago

  • Version trunk

@sabernhardt
6 years ago

refreshed patch

#6 @sabernhardt
6 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
6 years ago

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

#8 @SergeyBiryukov
6 years ago

  • Resolution → fixed
  • Status reviewing → 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.