Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wordpress remove user roles

//REMOVE UNUSED ROLES 
add_action('admin_menu', 'remove_built_in_roles');
 function remove_built_in_roles() {
    global $wp_roles;
    $roles_to_remove = array('subscriber', 'contributor', 'author', 'editor');
    foreach ($roles_to_remove as $role) {
        if (isset($wp_roles->roles[$role])) {
            $wp_roles->remove_role($role);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: wp get post author link 
Php :: get woocommerce order details Object 
Php :: add custom user meta and display it in user page 
Php :: wpdb-prepare 
Php :: How to fix MySql: index column size too large (Laravel migrate) 
Php :: php set alternatives 
Php :: php cookie never expire 
Php :: PHP Max Input Vars 
Php :: php echo alot of html 
Php :: php mess detector 
Php :: num_rows in php 
Php :: undefined method JeroenNotenLaravelAdminLteHelpersMenuItemHelper::isSearchBar() 
Php :: loop object property laravel 
Php :: php $randomUA[rand(0, count($randomUA) 1) 
Php :: laravel drop column 
Php :: larevel version artisan 
Php :: absolute path php 
Php :: wordpress show notice 
Php :: page expire in laravel 
Php :: php json string to associative array 
Php :: php get all php files in a directory 
Php :: php.ini path 
Php :: branch from other branch 
Php :: laravel 8 change password 
Php :: wordpress get the product images 
Php :: how to add attributes to an object in php 
Php :: flatten a multi-dimensional array into a single array in php 
Php :: laravel difference between fill and update 
Php :: how to use multiple permission in blade 
Php :: how to get local current time in laravel 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =