Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22113 closed enhancement (fixed)

Checking for the 'wp' JavaScript variable could be simpler

Reported by: evansolomon's profile evansolomon Owned by: koopersmith's profile koopersmith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: General Keywords: has-patch
Focuses: Cc:

Description

In a few places we do this:

if ( typeof wp === 'undefined' )
    var wp = {};

That could be simplified to a one liner that's easier to read:

window.wp = window.wp || {};

Attachments (1)

22113.patch (2.3 KB) - added by evansolomon 12 years ago.

Download all attachments as: .zip

Change History (4)

#1 @evansolomon
12 years ago

  • Keywords has-patch added

#2 @koopersmith
12 years ago

  • Milestone changed from Awaiting Review to 3.5
  • Version set to trunk

Nice patch.

@evansolomon
12 years ago

#3 @koopersmith
12 years ago

  • Owner set to koopersmith
  • Resolution set to fixed
  • Status changed from new to closed

In [22126]:

Improve the lazy instantiation of the 'wp' JavaScript variable. props evansolomon, fixes #22113.

Note: See TracTickets for help on using tickets.