List of users with email and role

That’s the correct way to get what you need. Though I’m not sure why WordPress returns an array of roles since ( to my knowledge ) you can only have 1 role at a time. Roles being an array you can modify by just retrieving the role index 0: $blogusers = get_users(); // Array of … Read more

Let editors view post in admin but not be able to perform a save/edit

How about remove_meta_box( $id, $page, $context );? https://codex.wordpress.org/Function_Reference/remove_meta_box This will remove the Publish meta box which contains the save button… function disable_save() { if( !current_user_can( ‘edit_post’ ) ) { // Or whatever check you need to make remove_meta_box( ‘submitdiv’, ‘your-chosen-post-type’, ‘side’ ); } } // disable_save add_action( ‘admin_menu’, ‘disable_save’ );

How to change a user’s role depending on date registered?

Close, your date comparison is slightly off – user_registered will be a MySQL datetime, so your string comparison will never evaluate true. Instead, convert it to just the date: $registered = mysql2date( ‘Y-m-d’, $user->user_registered ); Now we’re talking: if ( ‘2015-10-01′ === $registered ) { // chocks away } Update: Here’s a complete snippet that … Read more

Let users edit their role from the frontend

You could make a widget that updates the role: Widget has a drop down select input Select input submits a Ajax call to backend Backend Ajax call processor updades the user meta Pass the User ID along with the role ID Update user meta with update_user_meta( $user_id, $meta_key, $meta_value, $prev_value )

remove_cap nothing changes

Look at the remove_cap method from WP_User class- /** * Remove capability from user. * * @since 2.0.0 * @access public * * @param string $cap Capability name. */ public function remove_cap( $cap ) { if ( ! isset( $this->caps[ $cap ] ) ) { return; } unset( $this->caps[ $cap ] ); update_user_meta( $this->ID, $this->cap_key, … Read more