Skip to:
Content
Pages
Categories
Search
Top
Bottom

Modifying the BuddyPress admin bar not working in bp-custom.php


  • Sven Lehnert
    Participant

    @svenl77

    I want to modify the admin bar.

    If I write custom functions in the functions.php all is done correct.

    But if I place it in the bp-custom.php I have the buddypress and my own functions placed in the admin bar.

    Hire is what I did:

    // **** Default BuddyPress admin bar logo ********
    function bp_adminbar_rr_logo() {
    global $bp;

    echo '<a href="' . $bp->root_domain . '"><img id="admin-bar-logo" src="' . apply_filters( 'bp_admin_bar_logo_src', get_stylesheet_directory_uri(). '/_inc/images/admin_bar_logo.gif' ) . '" alt="RR-HOME" /></a>';
    }

    // **** "Random" Menu (visible when not logged in) ********
    function bp_adminbar_rr_menu() {
    global $bp, $current_user;
    get_currentuserinfo();?>

    <?php if ( is_user_logged_in() ) { ?>
    <div id="rr-login-fav">
    <li class="align-right">
    <a href="<?php bloginfo('url'); ?>/favoriten">Meine Favoriten</a>
    </li>
    </div>

    <div id="rr-login-abmelden">
    <li class="align-right">
    <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Abmelden</a>
    </li>
    </div>

    <div id="rr-login-name">
    <li class="align-right">
    <a href="<?php bloginfo('url'); ?>/members/<?php echo $current_user->user_login;?>">Hallo <?php echo $current_user->user_login;?>!</a>
    </li>
    </div>
    <?php
    } else {?>
    <div id="rr-login-name">
    <li class="align-right">
    <a href="<?php bloginfo('url'); ?>/wp-login.php">Hallo Gast!</a>
    </li>
    </div>
    <?php }?>
    <?php

    $doing_admin_bar = false;
    }
    remove_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
    add_action( 'bp_adminbar_logo', 'bp_adminbar_rr_logo' );

    remove_action('bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
    add_action('bp_adminbar_menus', 'bp_adminbar_rr_menu', 100);

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Modifying the BuddyPress admin bar not working in bp-custom.php’ is closed to new replies.
Skip to toolbar