Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Change Login & Register Links in Admin Bar

@webplayer

Participant

I stumbled upon this post suggesting a snippet to put into bp-custom.php (a tweaks and snippets file for buddy press located in the plugins directory), but I can’t get it to work. I think there is an issue with my coding.

I am using BuddyPress 2.1.1

Here is my bp-custom.php file:

<?php
// hacks and mods will go here

//Change Admin Bar Login Links
function custom_bp_adminbar_login_menu() {
    global $bp;
    global $wp;
    remove_action('bp_adminbar_menus', 'bp_adminbar_login_menu', 2);
    if (is_user_logged_in())
        return false;
    echo '<li class="bp-login no-arrow"><a data-reveal-id="tmpl_reg_login_container" href="javascript:void(0);" onClick="tmpl_login_frm();">' . __('Log In', 'buddypress') . '</a></li>';
    // Show "Sign Up" link if user registrations are allowed
    if (bp_get_signup_allowed()) {
        echo '<li class="bp-signup no-arrow"><a data-reveal-id="tmpl_reg_login_container" href="javascript:void(0);" onClick="tmpl_registretion_frm();">' . __('Sign Up', 'buddypress') . '</a></li>';
    }
}

add_action('bp_adminbar_menus', 'custom_bp_adminbar_login_menu', 1);

?>
Skip to toolbar