Posts Tagged ‘hide dashboard’
Wednesday, 8 September 2010 by Erock in Wordpress Tips • 10 Comments
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}
//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}
Categories
Archives
- Pro -Sites Shortcodes, Functions, And Level Checks
- Automatic WP Photo Gallery From Facebook Page Photos!
- Analytics 360 For Editors
- Add nofollow rel tags to image widget
- Image Widget Alignment Fix
- Add GD Star Rating next to Post Title
- Change The Buddypress Admin Bar Logo And Link In WP3 & BP 1.2+!
- New Dashboard Lockdown & WordPress To Buddypress Profile Page Plugin!
- Hide The WordPress Dashboard and wp-admin COMPLETELY!
- Blogs & Members Directory, Strange Nav Spacing FIX
Tags
art wear
ashland
ashland oregon
buddypress
chrome
clear dashboard
code
dashboard widgets
download
drop down menu
hawaii
iframe
image widget
kauai
kauai hawaii
kauai web
limit login attempts
multi-site
new blog defaults
oregon
paintball
plugin commander
plugin management
plugin management update
remove dashboard widgets
remove recent drafts
remove right now
safari
search engine optimization
shortcode
southern Oregon
web design
web development
web hosting
webkit
wordpress
wordpress mu
wordpress security
wp3
wp3 compatible
wpms
wpmu
wpmu2.9
wpmu compatible
wpmu security
Tags
art wear
ashland
ashland oregon
buddypress
chrome
clear dashboard
code
dashboard widgets
download
drop down menu
hawaii
iframe
image widget
kauai
kauai hawaii
kauai web
limit login attempts
multi-site
new blog defaults
oregon
paintball
plugin commander
plugin management
plugin management update
remove dashboard widgets
remove recent drafts
remove right now
safari
search engine optimization
shortcode
southern Oregon
web design
web development
web hosting
webkit
wordpress
wordpress mu
wordpress security
wp3
wp3 compatible
wpms
wpmu
wpmu2.9
wpmu compatible
wpmu security