Answers for "Add custom css for specific user role in wordpress"

PHP
2

wordpress make custom role

/* Create Staff Member User Role */
add_role(
    'staff_member', //  System name of the role.
    __( 'Staff Member'  ), // Display name of the role.
    array(
        'read'  => true,
        'delete_posts'  => true,
        'delete_published_posts' => true,
        'edit_posts'   => true,
        'publish_posts' => true,
        'upload_files'  => true,
        'edit_pages'  => true,
        'edit_published_pages'  =>  true,
        'publish_pages'  => true,
        'delete_published_pages' => false, // This user will NOT be able to  delete published pages.
    )
);
Posted by: Guest on September-29-2020
0

add user role to wp admin page css

function wpa66834_role_admin_body_class( $classes ) {
    global $current_user;
    foreach( $current_user->roles as $role )
        $classes .= ' role-' . $role;
    return trim( $classes );
}
add_filter( 'admin_body_class', 'wpa66834_role_admin_body_class' );
Posted by: Guest on October-21-2020

Code answers related to "Add custom css for specific user role in wordpress"

Browse Popular Code Answers by Language