You need to upgrade your Flash Player to version 10 or higher.

Wordpress 3 Compatible

I have seen several plugins that “hide” the dashboard from subscribers, but none that functions as I want.
I don’t want it to allow only the tools, and profile page. I want it to straight kick the user out of the dashboard!

So, I wrote my own plugin that does that. If anyone that is not an admin (cannot activate plugins) attempts to access the dashboard via url or link, they are redirected to the front of the site. sorry, access denied..

Here is my code. Just drop this in your themes functions.php file and edit the url of the redirect to whatever you want.

//hook onto dashboard and redirect all non admin to front site
add_action("init","redirect_nonadmin_fromdash");
function redirect_nonadmin_fromdash(){

if (!current_user_can('activate_plugins')) {
// Edit Line Below For Your Own Redirect
header( 'Location: http://www.erikshosting.com' ) ;
}
}
 

So I installed the wpmu dev teams blogs directory and their members directory plugins on the wpmu triden theme. I noticed that when I clicked on the link and went to one of the directory pages, the page spacing in the navbar got way big. I figured their was some spacing issue coming from the plugin, but it turns out its a little different than that. Looks like the ‘current_page_item’ was generating an empty href link before the actual link. So their were two links per <li> tag for the members directory page nav link when on that page. same with the blogs directory. Also, when you remove this filter, you stop the plugin from renaming the page, so you can edit the title of the page in the wp editor, and have the on page title actually reflect that, rather than letting the plugin rename the page ‘blogs’ or ‘members’.

So how do you fix it?

Open up the blogs directory plugins php file, and find and remove the following line:

add_filter('the_title', 'blogs_directory_title_output', 99, 2);

Now in the Members Directory, Find and remove this line:

add_filter('the_title', 'members_directory_title_output', 99, 2);
 

Want to add all your pages into your buddypress admin bar automatically?

It’s easy as pie! Just add wp_list_pages to your buddypress bar with the following code!

Create a file called erocks-admin-bar-mod.php in your /plugins/ dir, put in the following code, then activate the BP Nav Bar Mods Plugin on the plugin control panel

<?php
/*
Plugin Name: BP Nav Bar Mods - Add All Pages
Plugin URI: http://erikshosting.com
Description: Add All Your Pages To The Buddypress Admin Bar Automatically!

Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<!-- Call All Pages Via A Wordpress Shortcode! -->
<?php wp_list_pages('title_li='); ?>
<?php
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>

Or How About As A Drop Down Menu?

<?php
/*
Plugin Name: BP Nav Bar Mods - Add All Pages
Plugin URI: http://erikshosting.com
Description: Add All Your Pages To The Buddypress Admin Bar Automatically!

Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<!-- Call All Pages Via A Wordpress Shortcode As A Drop Down! -->
<li><a href="#">Pages</a>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
</li>
<?php
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>
 

Now, How About We Remove The Arrow Images From Our Non- Drop Down Menu Items

All you have to do is override the <li> tags background css attribute. It’s easy, watch..

<li style="background:none;">
//Insert your link url or relative url, and your link text below
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>

& Bam, those drop down arrows are gone from the link.

 

It is entirely possible to add your own links to the buddypress bar without modifying core files. It is also possible to add your own drop down menus complete with flyout menus. Let me show you how..

First, lets tackle adding a simple link to the buddypress admin bar.

What I’m going to do is tap into the buddypress admin bar and add a link using a php file placed in the ‘/wp-content/plugins/’ folder and activated via the plugins menu. Create a file in your /plugins/ dir and name it erocks-admin-bar-mods.php then drop the following code into it. After this, go to your plugins page, and activate the BP Nav Bar Mods Plugin.

Lets create that simple link!

<?php
/*
Plugin Name: BP Nav Bar Mods - Add Link
Plugin URI: http://erikshosting.com
Description: Add A Simple Link To The Buddypress Admin Bar
Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<li>
<!-- Insert your link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<?php
}
// Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>

Now Lets Add Multiple Links To The Buddypress Bar..

Pay Special Attention to Enclosing The Href In <li> Tags Each Time.

<?php
/*
Plugin Name: BP Nav Bar Mods - Add Multiple Links
Plugin URI: http://erikshosting.com
Description: Add Multiple Link To The Buddypress Admin Bar
Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<li>
<!-- Insert your 1st link url or relative url, and your link text below -->
<a href="http://EXAMPLE1.COM">EXAMPLE LINK TEXT1</a>
</li>
<li>
<!-- Insert your 2nd link url or relative url, and your link text below -->
<a href="http://EXAMPLE2.COM">EXAMPLE LINK TEXT2</a>
</li>
<li>
<!-- Insert your 3nd link url or relative url, and your link text below -->
<a href="http://EXAMPLE3.COM">EXAMPLE LINK TEXT3</a>
</li>
<?php
}
//Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>

So you see its easy to add multiple links, you just have to repeat the format..

Next Lets Add A Drop Down Menu To The Buddypress Bar

All we gotta do is make use of a <ul> tag inside of your parent items <li> tag. Just like this..

<?php
/*
Plugin Name: BP Nav Bar Mods - Add Drop Down Menu
Plugin URI: http://erikshosting.com
Description: Add A Drop Down Menu To The Buddypress Admin Bar
Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<li>
<!-- Insert your parent link url or relative url, and your link text below -->
<a href="http://EXAMPLE1.COM">TOP PARENT MENU LINK TEXT</a>
//Start The Drop Down Menu By Not Closing The LI Tag From The Item Above, &amp; By Starting A UL Tag Below
<ul>
<li>
<!-- Insert your 1st dropdown menu sub item link url or relative url, and your link text below -->
<a href="http://EXAMPLE2.COM">EXAMPLE LINK TEXT2</a>
</li>
<li>
<!-- Insert your 2nd dropdown menu sub item l link url or relative url, and your link text below -->
<a href="http://EXAMPLE3.COM">EXAMPLE LINK TEXT3</a>
</li>
<!-- Below Ends The Drop Down Menu By Closing The UL and LI Tags -->
</ul>
</li>
<?php
}
//Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>

Pretty Easy.

What About Flyout Menus? You Know, Sub-Sub-Menus?

No Problem, thats just more easy work with the <li> and <ul> tags.. We just repeat what we did above, but go another level with the <ul> and <li> tags. Watch..

<?php
/*
Plugin Name: BP Nav Bar Mods - Add Drop Down With Flyout
Plugin URI: http://erikshosting.com
Description: Add Drop Down With Flyout Menu To The Buddypress Admin Bar
Author: Erock
Version: 1.0

Author URI: http://erikshosting.com
*/
//Links and Menus Added To The Following Function Are Always Visible On The BP Bar
function bp_adminbar_currentsite_menu() {

global $bp;
?>
<li>
<!-- Insert your parent link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">TOP PARENT MENU LINK TEXT</a>
<!-- Start The Drop Down Menu By Not Closing The LI Tag From The Item Above, &amp; By Starting A UL Tag Below -->
<ul>
<li>
<!-- Insert your 1st dropdown menu sub item link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<li>
<!-- Insert your 2st dropdown menu sub item link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<li>
<!-- Start The Flyout Menu Off The Item Below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
<!-- Instead of Closing the LI tag, Start a UL tag To Create The Flyout Menu -->
<ul>
<li>
<!-- Insert your 1st flyout menu sub- sub item link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<li>
<!-- Insert your 2st flyout menu sub- sub item link url or relative url, and your link text below -->
<a href="http://EXAMPLE.COM">EXAMPLE LINK TEXT</a>
</li>
<!-- Below Ends The Flyout Menu By Closing The UL And LI Tags -->
</ul>
</li>
<!-- Go Back To The Drop Down Menu And Add Another Item -->
<li>
<a href="http://EXAMPLE4.COM">EXAMPLE LINK TEXT4</a>
</li>
<!-- Below Ends The Drop Down Menu By Closing The UL and LI Tags -->
</ul>
</li>
<?php
}
//Call The Function Above
add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999);
?>

Real easy. You can add multiple flyout menus, just continue repeat the format.