Because the WP_ADMIN constant name can be bound in multiple files, all instances should check ! defined first. wp-admin/admin.php already has this check.

See #27881.


git-svn-id: https://develop.svn.wordpress.org/trunk@28478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-18 20:41:28 +00:00
parent f083cc4e9b
commit af0851cc0d
4 changed files with 12 additions and 5 deletions

View File

@ -14,7 +14,9 @@
* @since 2.1.0
*/
define( 'DOING_AJAX', true );
define( 'WP_ADMIN', true );
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
/** Load WordPress Bootstrap */
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );

View File

@ -9,7 +9,9 @@
*/
/** We are located in WordPress Administration Screens */
define('WP_ADMIN', true);
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
if ( defined('ABSPATH') )
require_once(ABSPATH . 'wp-load.php');

View File

@ -11,8 +11,9 @@
*
* @since 2.3.2
*/
if ( ! defined('WP_ADMIN') )
define('WP_ADMIN', true);
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
if ( ! defined('WP_NETWORK_ADMIN') )
define('WP_NETWORK_ADMIN', false);

View File

@ -10,7 +10,9 @@ if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action']
define( 'DOING_AJAX', true );
}
define('WP_ADMIN', true);
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
if ( defined('ABSPATH') )
require_once(ABSPATH . 'wp-load.php');