Remove WP_SHOW_ADMIN_BAR and go off existing and new defines on page type. See #15315

git-svn-id: http://svn.automattic.com/wordpress/trunk@16221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-11-06 09:41:03 +00:00
parent 9451fa0d1b
commit ee291ef5a5
8 changed files with 15 additions and 11 deletions

View File

@ -13,7 +13,6 @@
*/
define('DOING_AJAX', true);
define('WP_ADMIN', true);
define('WP_SHOW_ADMIN_BAR' , false);
if ( ! isset( $_REQUEST['action'] ) )
die('-1');

View File

@ -9,7 +9,7 @@
* @subpackage Administration
*/
define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');

View File

@ -5,6 +5,9 @@
* @package WordPress
* @subpackage Administration
*/
// TODO route this pages via a specific iframe handler instead of the do_action below
if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
define('IFRAME_REQUEST' , true);
/** WordPress Administration Bootstrap */
require_once('./admin.php');

View File

@ -6,7 +6,7 @@
* @subpackage Press_This
*/
define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);
/** WordPress Administration Bootstrap */
require_once('./admin.php');

View File

@ -6,7 +6,7 @@
* @subpackage Administration
*/
define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);
/** WordPress Administration Bootstrap */
require_once('./admin.php');

View File

@ -11,7 +11,6 @@
* @var bool
*/
define('APP_REQUEST', true);
define('WP_SHOW_ADMIN_BAR' , false);
/** Set up WordPress environment */
require_once('./wp-load.php');

View File

@ -328,13 +328,17 @@ function wp_admin_body_style() {
*/
function is_admin_bar_showing() {
global $show_admin_bar;
/* For all these types of request we never want an admin bar period */
if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
return false;
if ( ! isset( $show_admin_bar ) || null === $show_admin_bar ) {
$show_admin_bar = true;
if ( defined('WP_SHOW_ADMIN_BAR') )
$show_admin_bar = (bool) WP_SHOW_ADMIN_BAR;
else if ( ! is_user_logged_in() || ( is_admin() && ! is_multisite() ) )
if ( ! is_user_logged_in() || ( is_admin() && ! is_multisite() ) ) {
$show_admin_bar = false;
} else {
$show_admin_bar = true;
}
}
$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );

View File

@ -11,7 +11,6 @@
* @var bool
*/
define('XMLRPC_REQUEST', true);
define('WP_SHOW_ADMIN_BAR' , false);
// Some browser-embedded clients send cookies. We don't want them.
$_COOKIE = array();