Redirect admin 403 “Cheatin uh?” admin pages

Sounds like this is what you’re running into. admin_page_access_denied may be the hook you want to use for this. try function dont_show_cheatin_page() { if ( current_user_can( ‘do_not_allow’ ) ) { wp_safe_redirect( admin_url()); // custom redirect instead of Cheatin 403 page exit; } } add_action(‘admin_page_access_denied’, ‘dont_show_cheatin_page’);

Custom Post Type – after disable ‘Add New’, I can’t edit and delete post

Full credit to this answer on Stack Overflow: you need to set the create_posts value to do_not_allow (or false in WordPress versions below 4.5) and crucially set the map_meta_cap to true: register_post_type( ‘custom_post_type_name’, array( ‘capability_type’ => ‘post’, ‘capabilities’ => array( ‘create_posts’ => ‘do_not_allow’, // Prior to WordPress 4.5, this was false ), ‘map_meta_cap’ => true, … Read more

WordPress remove capability post ,media completely for custom role

Remove a top level admin menu: function custom_menu_page_removing() { remove_menu_page( $menu_slug ); } add_action( ‘admin_menu’, ‘custom_menu_page_removing’ ); To remove only certain menu items include only those you want to hide within the function. To remove menus for only certain users you may want to utilize current_user_can(). You can take a look at https://codex.wordpress.org/Function_Reference/remove_menu_page

Allow editors to switch sites (Multisite)

Although question is not quite clear to me, because: ==case 1== if you have multisite WP, then users are shared with same username/password/etc). Just you should set the roles individually per sub-site. But if there are many users and you want to automatize the process, you can use: https://wordpress.org/plugins/multisite-user-sync/ https://wordpress.org/plugins/multisite-user-role-sync/ or some similar alternatives update: … Read more