WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is working great in the front site wp admin bar:

add_action('wp_before_admin_bar_render', 'customize_admin_bar');

function customize_admin_bar() {
    global $wp_admin_bar;
    if (is_user_logged_in()) {
        if ( !is_admin()) {
          $wp_admin_bar->remove_menu('edit-profile');
          //$wp_admin_bar->remove_menu('user-info');    
          $wp_admin_bar->remove_menu('comments');
          $wp_admin_bar->remove_menu('new-media');
          $wp_admin_bar->remove_menu('new-tvr_booking');
          $wp_admin_bar->remove_menu('new-vp_orbitslides'); 
          $wp_admin_bar->remove_menu('orbitslider_settings');
          //$wp_admin_bar->remove_menu('site-name');
          //$wp_admin_bar->remove_menu('dashboard');
          /*$wp_admin_bar->add_menu( array(
            'id' => 'custom-account',
            'parent' => 'my-account',
            'title' => __( 'Mi cuenta'),
            'href' => '/pedidos/products-page/your-account/'
            ) );*/
        }

    }
}

but not in the wp-admin menubar, why?

share|improve this question
up vote 3 down vote accepted

Short answer, but you have a !is_admin() condition. That will prevent the bulk of that code from running on the back end. Remove that and the code should work on both front and back.

share|improve this answer
    
THANKS! used !current_user_can('administrator') instead, cause I want the actual admin to be able to see everything – Toni Michel Caubet May 26 '13 at 2:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.