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->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?


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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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