Tag Info

New answers tagged

0

Add the capabilities to the role. Replace 'cpt' with the name of your custom post type: $role = get_role( 'contributor' ); $role->add_cap( 'delete_published_cpt' ); $role->add_cap( 'delete_others_cpt' ); $role->add_cap( 'delete_cpt' ); $role->add_cap( 'edit_others_cpt' ); $role->add_cap( 'edit_published_cpt' ); $role->add_cap( 'edit_cpt' ...


0

You can write a small custom plugin, that run on the activation hook. A example, write from scratch function fb_add_roles( $user_id ) { foreach( get_blog_list( 0, 'all' ) as $key => $blog ) { if ( is_user_member_of_blog( $user_id, $blog[ 'blog_id' ] ) ) continue; switch_to_blog( $blog[ 'blog_id' ] ); $role = ...


1

You can change the role of any user by editing the users profile. No need to add any more code when this option is already built into WordPress. Or You could use code to change all current users with the subscriber role to editor: $current_user = wp_get_current_user(); // Remove role $current_user->remove_role( 'subscriber' ); // Add role ...


0

I resolved this by adding checks via the "content_edit_pre" WP hook. I quickly check on the status of the post and if it is already pending I return the user back to the post listing page and then show an error. // Redirect edit post page back to the list page when pending add_action( 'content_edit_pre', 'my_check_status_before_editing'); function ...


0

The accepted answer mentions User Role but actually uses the function for User Capability Here's the solution for User Roles function wpse66094_no_admin_access() { $redirect = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : home_url( '/' ); global $current_user; $user_roles = $current_user->roles; $user_role = ...


0

After a quick search, i got my answer here https://wordpress.org/support/topic/how-to-allow-non-admins-editors-authors-to-use-certain-wordpress-plugins By changing all occurances of 'manage_options' to 'edit_pages' in my Plugins files. Editors are allowed to use plugins with Edit_pages



Top 50 recent answers are included