#474 closed enhancement (fixed)
site-wide option site-admin->buddypress
Reported by: | Frumph | Owned by: | |
---|---|---|---|
Milestone: | Priority: | major | |
Severity: | Version: | ||
Component: | Keywords: | ||
Cc: |
Description
Need a site-wide option for turning off the admin bar completely so it doesn't show at all, ever.
Change History (7)
#2
@
16 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Created file:
bp-custom.php in the mu-plugins folder.
added:
<?php
remove_action( 'wp_footer', 'bp_core_admin_bar' );
?>
.. the bar still there.
#3
@
16 years ago
- Resolution set to fixed
- Status changed from reopened to closed
My mistake:
remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
remove_action( 'wp_head', 'bp_core_admin_bar_css' );
Use the latest trunk. I've tested this and it works.
#4
@
16 years ago
I should also note, by doing this you are disabling access to the notifications for users. It's generally not a good idea unless you are going to reproduce the content somewhere else.
#5
follow-up:
↓ 6
@
16 years ago
Sidebar code replacement:
<?php if ( is_user_logged_in() && $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id )) { ?> <?php global $bp; ?> <li> <ul> <h2>Notifications (<span><?php echo count($notifications) ?></span>)</h2> <?php $counter = 0; ?> <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?> <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> <?php $counter++; ?> <?php } ?> </ul> </li> <?php } ?>
#6
in reply to:
↑ 5
@
16 years ago
Replying to Frumph:
sorry fixed, had to move global $bp *before* the get_notifications
Sidebar code replacement:
<?php global $bp; if ( is_user_logged_in() && $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id )) { ?> <li> <ul> <h2>Notifications (<span><?php echo count($notifications) ?></span>)</h2> <?php $counter = 0; ?> <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?> <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> <?php $counter++; ?> <?php } ?> </ul> </li> <?php } ?>
This is quite easy to do. Create a file called bp-custom.php and place it in the mu-plugins folder.
Add this code:
remove_action( 'wp_footer', 'bp_core_admin_bar' );