@fpats
This will remove it for subscribers but leaves it for admin. Add it to bp-custom.php
function bphelp_custom_toolbar($wp_toolbar) {
global $wp_admin_bar;
if ( !current_user_can( 'manage_options' ) ) {
$wp_toolbar->remove_node('site-name');
}
}
add_action('admin_bar_menu', 'bphelp_custom_toolbar', 999);
thanks alot @bp-help that worked perfectly in removing the left side menu.
unfortunately it’s also somehow disabled front end editing of user profiles.
is there another way?
@fpats
Did you put the code between opening and closing php tags? I have it working on fresh install of WP 3.6 beta2 and BP 1.8 beta1 so if its not working for you it may be some other code you introduced interfering with the function. That code doesn’t do anything to the profile menu in the top right, it just removes the node in the top left for sitename/dashboard.
I really don’t get it, i’ve done nothing but add that code.
So i removed it… the left side menu is back on the admin bar as it should be but i still can’t access front end profiles, i just get a white screen.
@fpats
Did you add it to bp-custom.php? Can you put a copy of it on pastebin and supply the link?
@fpats
Have you tried temporarily commenting out your function to see if it is causing your issue?
And now i can’t delete posts or upload media, it’s like the site is completely broken now. I’ve been working since 6am to get this ready for tomorrow and every thing was perfect until i added this bit of code.
Is anyone else from Buddypress online who can offer advice please?
sorry @bp-help i’m not sure what you mean. i’m learning as i go along here, how would i do that?
@fpats
To comment out that block of code in your function just add /* after the opening php tag and before your function. After the last } then add */ before the closing php tag.
Note comments basically prevents php from reading the function.
Here is your function commented:
<?php
/* //Begin comment
function redirect_group_home() {
global $bp;
$path = clean_url( $_SERVER['REQUEST_URI'] );
$path = apply_filters( 'bp_uri', $path );
if (bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false ) {
echo "HERE WE GO...";
echo "<PRE>"; print_r($bp->groups->current_group); echo "</PRE>";
echo $bp->groups->current_group->status;
echo $bp->groups->current_group->is_user_member;
if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
echo "<PRE>"; print_r($bp->bp_options_nav); echo "</pre>";
exit();
if ($bp->bp_options_nav['groups']['announcements']['slug']) {
bp_core_redirect( $path . $bp->bp_options_nav['groups']['announcements']['slug'] . '/' );
} else {
bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
}
bp_core_redirect( $path . 'welcome/' ); //quick hack for some other tab
}
}
}
*/ //END COMMENT
?>
Thank you very much, that’s restored the front end profiles again.
I’ve added your original code and removed the link to the dashboard too.
Will i be ok leaving that commmented out or will have an effect on something else?
Sorry for all the questions and thanks again for your help.
If you’re available for hire i’ll be looking for someone to check over the site for us very soon to make sure it’s all as it should be.
@fpats
Leaving it commented out will not cause you any issues. Lots of developers use this technique while testing functions with other functions so they don’t loose the code by deleting it.
I can be contacted here:
bphelp.1@gmail.com
thanks again, i’ll drop you a line tomorrow 🙂