Show only users with the same role in Dashboard user list
Show only users with the same role in Dashboard user list
Show only users with the same role in Dashboard user list
$user = wp_get_current_user(); if (!current_user_can(‘activate_plugins’)) { add_action(‘admin_head’, ‘removeCategories’, 100); function removeCategories() { echo “<style>#product_cat-23{display: none !important;}</style>”; } } It’s admin_head for admin UI.
Extend user search in the users.php page to allow for searching by role and excluding specified email domains from the “users search” input box
Remove default wordpress roles
current_user_can() returning true for capability when the user and role do not have the capability
How to give access to the particular page in wordpress for specific username/email NOT roles [closed]
I believe you’d need to modify user roles on each site individually (if I’m understanding your question correctly). There’s a great plugin I use frequently called WPFront User Role Editor that allows you to check/uncheck user capabilities like you mentioned. The free version should be fine for what you’re trying to do. I personally use … Read more
I found the solution to my problem. It had to do with my function that removes the manager role. I commented it out, and it works. My bad. Here’s the working code: if ( ! ( role_exists( ‘manager’ ) ) ) { function new_role_manager() { global $wp_roles; if ( ! isset( $wp_roles ) ) { … Read more
This is based on Bosco’s comment. You can do this instead of line 3 in the above code: wp_roles()->is_role( ‘editor’ ); That grabs a WP_Roles object (what the code you had tries to do by getting a global variable) and calls the same is_role() function.
As far as I know, WordPress only stores original authors of the posts. If you want to also save the publisher’s ID, you need to do a bit of custom coding, or use some 3rd party plugin. Essentially what you need to do is to store the user ID whenever the post status is being … Read more