How to Remove Dashboard Widgets According to User Role

Add Tool

Remove Dashboard Widgets According to User Role


Remove Dashboard Widgets According to User Role

It’s also relatively simple to disable dashboard widgets depending on user role, just by introducing an if statement (where 3 is the user level). Add this snippets to "Remove dashboard widgets according to user role" WordPress snippets in functions.php file

<?php
function customize_meta_boxes() {  
    global $current_user;  
    get_currentuserinfo();  
    if ($current_user->user_level < 3)  
        remove_meta_box('postcustom','post','normal');  
    }  
add_action('admin_init','customize_meta_boxes');
?

You can substitute any of the meta box removal lines from line #6 with the conditional one inside the if statement here.

Source: http://coding.smashingmagazine.com


Tags: Dashboard, Dashboard Widgets, functions.php, JavaScript, JQuery, Languages, Programming, Snippets, user role, WordPress
Payza

About Masum Billah

Remove Dashboard Widgets According to User Role 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: How to Remove Dashboard Widgets According to User Role


adf.ly