There was no option to edit this in the BuddyPress admin menu, no plugin to alter this, and trying to search for a solution turned up results that either asked how to fix it, or were about a slightly different problem (e.g. disabling the BuddyPress admin bar and creating one's own).
I have created a plugin to fix this- 'BuddyPress Adminbar Log In Fix' or 'BP-adminbar-c' for short.
To fix the log in behaviour of the button is not too difficult, we create a function for the button, active only when the user is not logged in:
Then, we create a function to remove the original log in button, and replace it with our new button, appending it to the WordPress footer which calls the BuddyPress admin bar:
function remv_bp_adminbar_li(){
This plug in is available on GitHub: http://coopey.me/3xci7
To fix the log in behaviour of the button is not too difficult, we create a function for the button, active only when the user is not logged in:
function custom_adminbar_li_button() {
if (!is_user_logged_in()) {
echo '<li><a href="/wp-login.php/">Log In</a></li>';
}
}
Then, we create a function to remove the original log in button, and replace it with our new button, appending it to the WordPress footer which calls the BuddyPress admin bar:
function remv_bp_adminbar_li(){
remove_action('bp_adminbar_menus', 'bp_adminbar_login_menu', 2);
add_action('bp_adminbar_menus', 'custom_adminbar_li_button', 2);
}
add_action('wp_footer','remv_bp_adminbar_li',1);
This plug in is available on GitHub: http://coopey.me/3xci7
No comments:
Post a Comment