Order Status based on User Role
Order Status based on User Role
Order Status based on User Role
In WordPress, there is no concept of “super admins” in the same way that there is in a multisite installation. However, there may be users with the “administrator” role who have access to all areas of the site, including the WordPress settings. If you are an administrator and you are unable to access the WordPress … Read more
What I understand from your code: You want to list users with author role. You’re in the right direction, however, following are some tips to make your code better. Use role id in lowercase syntax. Change Author to author for role property. Get the results for once and avoid repeated calls. Save the results like … Read more
How might I enable a user to view Draft pages from a different Author, without the ability to edit?
Your question needs some additional context, but here’s a generic approach to what you’ve described. if ( is_user_logged_in() ) { $user = wp_get_current_user(); // Does user have the required role? if ( in_array( ‘some_role’, $user->roles ) && ‘some_meta_value’ == get_user_meta( $user->ID, ‘some_meta’, true ) ) { // Special content… } else { // User doesn’t … Read more
Found a solutin, using the following plugin: http://code.mincus.com/41/manage-your-posts-only-in-wordpress/
Try to change this code // Get the user object $user = new WP_User( get_current_user_id() ); $index = key( $user->roles ); $user_role = $user->roles[ $index ]; // User already got that user if ( $user_role == $role ) { echo sprintf( __( ‘You already have %s role.’ ), $role ); } else { // update … Read more
You have to set user role using user id. use below code to assign role to user. add below code after this line : $user_id = wp_create_user($firstname,$lastname,$email); set role to new created user. by default it will set subscriber role. $user_id_role = new WP_User($user_id); $user_role = !empty($_POST[‘role’]) ? $_POST[‘role’] : ‘subscriber’; $user_id_role->set_role($user_role); i have tested … Read more
Get users by rôle in a list
How to assign a custom gender to a user role?