Easiest way to create Reviewer Role: Can preview Drafts (and Private Pages) but not Edit them
Easiest way to create Reviewer Role: Can preview Drafts (and Private Pages) but not Edit them
Easiest way to create Reviewer Role: Can preview Drafts (and Private Pages) but not Edit them
Frontend delete CPT post with custom role user
A CSS rule would be the simple action. You can just create a single global admin area foot script set of instructions and disable a whole series of elements by user capability and simply add instructions as needed, and affect all areas of the admin area. functions.php or create a plugin that would give flexibility … Read more
I’ve figured out a possible way to do this, so I want to post my answer here for future reference and anyone else that might find it useful. There is a free plugin called “WP Remote Users Sync”, here is the page for it, it is also on github. This pluign only works on individual … Read more
How to protect content from public users and limit access to certain roles in WordPress 2023?
Any way to set user role permissions in the site editor?
function dashboard_redirect($url, $request, $user) { if (in_array(‘test_user_role’, (array) $user->roles)) { $url = admin_url(‘users.php’); }else{ $url = admin_url(‘index.php’); } return $url; } add_filter(‘login_redirect’, ‘dashboard_redirect’, 10, 3); The user can be passed into your function with a little more argument specificity.
How to redirect non admin user after login
As mentioned by Jacob Peattie: functions not loaded yet. You will need to use hooks/actions (init, wp etc) https://codex.wordpress.org/Plugin_API/Action_Reference e.g. function callMyMethod(){ $userLoggedIn = is_user_logged_in(); echo ‘INIT Action: User Logged in: ‘.var_export($userLoggedIn, true); if ( is_admin() ) { $canAccess = user_can_access_admin_page(); } } add_action(‘init’,’callMyMethod’); This answer is assuming you’re creating a plugin and calling the … Read more
Add the following code snippet to your WordPress theme’s functions.php file. Define the new user role and capabilities (you can customize this based on your needs) function add_custom_roles() { add_role( ‘corporate_customer’, ‘Corporate Customer’, array( ‘read’ => true, ‘edit_posts’ => true, ‘delete_posts’ => false, )); } add_action( ‘init’, ‘add_custom_roles’ ); A function to update the user … Read more