Skip to content

Commit

Permalink
Remove WP_SHOW_ADMIN_BAR and go off existing and new defines on page …
Browse files Browse the repository at this point in the history
…type. See #15315

git-svn-id: http://svn.automattic.com/wordpress/trunk@16221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
westi committed Nov 6, 2010
1 parent 9451fa0 commit ee291ef
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion wp-admin/admin-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
define('DOING_AJAX', true);
define('WP_ADMIN', true);
define('WP_SHOW_ADMIN_BAR' , false);

if ( ! isset( $_REQUEST['action'] ) )
die('-1');
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/media-upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @subpackage Administration
*/

define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);

/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
Expand Down
3 changes: 3 additions & 0 deletions wp-admin/plugin-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/press-this.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage Press_This
*/

define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);

/** WordPress Administration Bootstrap */
require_once('./admin.php');
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @subpackage Administration
*/

define('WP_SHOW_ADMIN_BAR' , false);
define('IFRAME_REQUEST' , true);

/** WordPress Administration Bootstrap */
require_once('./admin.php');
Expand Down
1 change: 0 additions & 1 deletion wp-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
14 changes: 9 additions & 5 deletions wp-includes/admin-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ee291ef

Please sign in to comment.