[wp-trac] [WordPress Trac] #14772: Administration bar

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 20 03:41:18 UTC 2010


#14772: Administration bar
----------------------------+-----------------------------------------------
 Reporter:  rmccue          |       Owner:  filosofo 
     Type:  task (blessed)  |      Status:  assigned 
 Priority:  normal          |   Milestone:  3.1      
Component:  Administration  |     Version:  3.1      
 Severity:  normal          |    Keywords:  multisite
----------------------------+-----------------------------------------------
Changes (by neoxx):

 * cc: neo@… (added)


Comment:

 Currently it's hard to check (and also to debug) whether the admin bar has
 been enabled.

 If I didn't miss something, with the current implementation we need to
 check for the constant and the filter. - So, I wrote the following code
 for one of my plugins:

 {{{
 function has_wp_admin_bar() {
     return ( function_exists('no_admin_bar') &&
     ( (!defined('WP_SHOW_ADMIN_BAR') && apply_filters('show_admin_bar',
 true) ) ||
     ( defined('WP_SHOW_ADMIN_BAR') && WP_SHOW_ADMIN_BAR) ) );
 }
 }}}

 First of all I have to check if the admin-bar functionality is available,
 which I do with ''no_admin_bar'' as this function is the only one which
 resides in ''functions.php''. Then I need to check if the constant has not
 been set and apply the filter as implemented in ''admin-bar.php''. If the
 constant has been set it needs to be true.

 Bottom-line: Imho we should get rid of the filter.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14772#comment:50>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list