English flagItalian flagKorean flagChinese (Simplified) flagChinese (Traditional) flagPortuguese flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroatian flagDanish flagFinnish flagHindi flagPolish flagRomanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flagAlbanian flagEstonian flagGalician flagMaltese flagThai flagTurkish flagHungarian flagBelarus flagIrish flagIcelandic flagMacedonian flagMalay flagPersian flag

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.

{code type=php}
//hook onto dashboard and redirect all non admin to front site
add_action(“admin_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’ ) ;
}
}
{/code}
 

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:

{code type=php}
add_filter(‘the_title’, ‘blogs_directory_title_output’, 99, 2);
{/code}

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

{code type=php}
add_filter(‘the_title’, ‘members_directory_title_output’, 99, 2);
{/code}
 

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

{code type=php}
<?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);

?>
{/code}

Or How About As A Drop Down Menu?

{code type=php}
<?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);

?>
{/code}

 

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..

{code type=php}
&lt;li style=”background:none;”&gt;
//Insert your link url or relative url, and your link text below
&lt;a href=”http://EXAMPLE.COM”&gt;EXAMPLE LINK TEXT&lt;/a&gt;
&lt;/li&gt;
{/code}

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