Permalink
Browse files

Improve the lazy instantiation of the 'wp' JavaScript variable. props…

… evansolomon, fixes #22113.

git-svn-id: http://core.svn.wordpress.org/trunk@22126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 4220ed4 commit 1baac22e9d6b55cb62e440a2a938a288fce597ed @koop koop committed Oct 6, 2012
@@ -1,5 +1,4 @@
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
(function( exports, $ ){
var api, extend, ctor, inherits,
@@ -1,5 +1,4 @@
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
(function( exports, $ ){
var api = wp.customize,
@@ -1,6 +1,5 @@
// Ensure the global `wp` object exists.
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
// HTML utility functions
// ----------------------
@@ -1,5 +1,4 @@
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
(function($){
var Attachment, Attachments, Query, compare;
@@ -1,5 +1,4 @@
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
(function( exports, $ ) {
var Uploader;
@@ -1,8 +1,7 @@
// Utility functions for parsing and handling shortcodes in Javascript.
// Ensure the global `wp` object exists.
-if ( typeof wp === 'undefined' )
- var wp = {};
+window.wp = window.wp || {};
(function(){
wp.shortcode = {

0 comments on commit 1baac22

Please sign in to comment.