You can check the current user role in the same action and apply “display none” for that specific user role
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
//The user has the "author" role
}
Related Posts:
- Apply custom role capabilities to administrator (without plugin)
- Roles & capabilities GUI that does not create separate table
- How do I redirect upon login a specific user based on role?
- Hide some items from Screen options in dashboard for products
- How to add another user to this remove_menu function?
- Add a new subscriber role using a function
- How to test for Super Admin
- Custom roles can’t access to wp-admin
- Custom registration URL lost when user makes signup mistake
- Custom function for specific user role
- Hide Author.php template from specific user role
- edit role display name and label name without plugins
- create shortcode to list users with specific meta key value
- Toggle User Roles with button
- How to change or add user role after getting post request data about pay? [closed]
- Execute a ultimate member action when user role is updated
- Allowing users to view private posts (pending approval)
- Allow Contributor to edit their own posts after Adm aproval
- How to add custom JavaScript in functions?
- How to set default post editor based on role?
- load CSS only for administrators on backend
- Adding additional roles on registration
- The Capability to choose post/page template
- How to add array [closed]
- Get users with different roles and call function on each of them (user_meta)
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- How to load a css file depending on the current role
- Allow user select role in wordpress default registration without plugin
- Add Change role button for list of user in an event
- How to show only specific category post by user role without plugin and restrict all other cats
- Change user role based on total number of items ordered
- Remove all video attachment, both files and post/postmeta from database?
- delete_user_meta for user in spesific group
- Change the second role depending on the first
- Restrict certain roles registrations by domain
- Multisite Admin Roles
- add_role menu pages are not visible
- Screen Options WordPress WYSIWYG
- Welcome Mails based on user role
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Would it be possible to disable embeds for specific user roles? If so, how?
- How to make my logged-in user-role shortcode displaying name instead of slug?
- remove_action on after_setup_theme not working from child theme
- Remove type attribute from script and style tags added by WordPress
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- Can the new 4.8v text widget visual editor be removed?
- Which WP functions do you need to use esc_html() or esc_url() on?
- How to get the image EXIF date/time and use it for the WP post date/time
- Programmatically Set First Image as Featured
- add_action in a function, is it possible?
- Add action hook conditionally – only when home.php in use
- Shortcode producing headers already sent error
- Enqueue Script with data attributes
- How to manually activate user in dashboard only by admin
- delete uploaded file
- How to reduce original image quality on upload?
- In WooCommerce I need to modify the thankyou.php page [closed]
- How to use get_media_embedded_in_content function
- Shortcode with parameters inside parameters
- When is wp_trim_excerpt() called?
- What is wrong with this Shortcode? I get it in a wrong place inside the content
- Change parent theme file function in child themes functions.php
- gform_after_submission content appears immediately after , not in post body [closed]
- How do you completely remove the default header and footer using functions.php?
- Unregister Nav Menu with fallback?
- Changes to functions.php not working
- Insert width & height attributes to all images displayed on each page
- Enqueuing Script in functions.php vs on the page
- Allowing SVG uploads in media uploader without plug-in
- Custom excerpt legnths for specific pages
- Unable to get_the_content(); of a post in WordPress via AJAX
- Remove default user registration, login and subscriber profiles
- How to load some jquery code to make validation in the theme customizer?
- Ajax call theme functions from front
- Show excerpt for only first post in query
- What does the author_nicename parameter do in get_author_posts_url()?
- Members only site – still need the lost password page accessible
- Load JS Script only for custom post types
- Hook specific functions if on a specific admin page
- Display first name of logged in user?
- How to overwrite / extent wordpress function is_email
- WordPress upload_mimes not working for front-end uploads of 3D files
- Identical custom taxonomy slugs for same hierarchical children
- How do I customize my wordpress Admin Area?
- Add caption functionality to custom WordPress theme
- User meta and author meta
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Removing permalink from post thumb in twentyeleven
- Sorting table function default
- Product object returns no sale price
- How to stop twenty fifteen theme from cropping featured images?
- Custom Post excerpt not working correctly
- Custom Nav Walker sub-menu
- Wait a result before enqueue
- How do I remove the date and category form my portfolio pages
- Default Custom Field Value Automatically Update
- meta tags doesnt fetch data from permalinks
- Get list of all custom tanonomy id