add_action('load-index.php', 'redirect_dashboard');
function redirect_dashboard() {
if ( ! is_admin() || current_user_can('activate_plugins') ) return;
$screen = get_current_screen();
if ( is_object($screen) && $screen->base == 'dashboard' ) {
$url = admin_url('edit.php');
wp_safe_redirect( add_query_arg( array('post_type' => 'product'), $url) );
die();
}
}
Related Posts:
- wp_update_user not updating
- Is WordPress’ is_user_logged_in() secure?
- Temporarily disable user role login and replace with message
- how to add custom user capabilities using add_user_meta or something else?
- Is there a way to set the user Role based on email domain
- pre_get_posts Remove posts based on meta value with ‘post__not_in’
- What is the difference between “create_users” and “add_users” capabilities?
- Access on specific pages in wordpress for a specific user
- How to ‘unpublish’ or ‘hide’ posts when user role changes?
- Set default page for user account in admin
- Hide Specific User Page
- Let new user role to ‘edit_others_posts’ of other user role, not of its own type
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- How do I remove the Other Roles field (from User Role Editor plugin) in wp-admin/user-new.php
- wordpress editor role remove all but ‘menus’ in appearance menu
- Parent User and Child User – relate users
- How to create user specific pages (not user role!)?
- Assigning certain authors to specific editors
- Restrict Access in Admin Panel
- Limit a user to have access to only specified pages?
- Plugin creation – how to add user rights?
- User restricted only show posts assigned to current user
- Restrict custom post content to specific user
- How can I programattically hide all admin notices for everyone except admin users
- Hide front-end from every logged out user and redirect them to the default login page
- Block user roles from accessing the WordPress dashboard
- How to restrict an admin page, if the user is not superadmin?
- Need to block user role from accessing bbPress all together
- How to create a front facing user sign up, log in and profile pages like FoodGawker.Com [closed]
- Infinite redirects at front end if logged in user is not an Admin (Toolset Access)
- Is there a way to allow users with “Subscriber” user role to access media library in backend and frontend
- How to make WP page accessile only to specific user roles
- grant multiple roles access to specific admin menu item
- How to allow suscriber to access specific pages in dashboard?
- Check what capabilitie(s) an action requires
- Removing Admin Bar Node Based on Role
- Restrict Access to the User Profile
- Is it possible to restrict a specific user to edit a specific custom post.
- New folder and file permissions are not correct
- How to change user role setting in members plugin so that user can only edit his own post?
- allow editors to edit menus?
- Is there way to rename user role name without plugin?
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- How to add a Capability to a User Role?
- How can I get a list of users by their role?
- How to allow editor to edit privacy page / settings only?
- Reset default roles and capabilities
- Allowing users to edit only their page and nobody else’s
- How to assign specific users the capability to edit specific pages / posts / custom post types
- How to filter the role selector?
- How can I change a user role upon visiting a page?
- How to let the Contributor role preview unpublished posts?
- Assign Subscriber capabilities to a custom user role
- Roles at registration (classipress)
- Contributors missing from author dropdown
- WordPress Multisite Layered Admins
- How to add author role as a custom field to custom post type in wordpress?
- How to add another user to this remove_menu function?
- How to display user role
- Users Role and Access
- Restricting access to content
- Only allow administrators and editors to access wp-admin
- Why does this check to see if user is authorized to edit a post fail for all but super admins?
- Hide everything on site for visitors except specific page IDs
- Conditional tag based on the role of author in author.php
- allow non logged in user to upload images in media library
- Assign a role to the user who registers on a form
- DISALLOW_FILE_EDIT constant being ignored
- How to change user role using hook
- Custom Roles for access to specific term(s)
- Custom Capabilities for CPT and Problem with current_user_can()
- Which capabilities are available in Gravity Forms Salesforce plugin? [closed]
- ‘upload_mimes’ filter seems to be restricting viewing/downloading as well
- Allow user edit widgets
- Problems using ‘add_role’
- Let editors view post in admin but not be able to perform a save/edit
- Capabilities don’t add
- Show menu in sidebar if on specific page AND specific user role (is_page, current_user_can)
- Conditional Tag for Wishlist membership. If the user is added to two levels show particular content
- Adding all custom capabilities to admin
- How to give plugin access to specific role(s)
- current_user_can( ‘edit_user’ ) does not work
- Need help with Task assigning and rewarding as currency which withdrawable
- Restrict Users to Only Edit Media Owned by Users in Their Role
- Remove plugin settings from post creation page for a user role
- Change role in maintenance mode
- How to make this custom capability work? [duplicate]
- Give a user role capability to create orders for clients
- Custom Admin Menu Order for all User Roles
- Localhost install: Administrator lost administrator access; cannot access Dashboard
- WordPress install checking permissions of user id 0
- Force “submit for review” on update?
- Allow users to change author of post
- Custom User Role
- Is there a way for a limited user to just view the page of a post without being able to edit it?
- How do I make a draft post accessible to everyone?
- Authors Ability to Review Post from Contributors
- Control Category of each user can post
- Get users by rôle in a list
- WordPress show content if current user get spesific role and spesific meta value