Users that are only assigned to your event_admin
role, don’t have the upload_files
capability, needed to display the featured image meta box.
Here’s the relevant code from the core:
if ( $thumbnail_support && current_user_can( 'upload_files' ) ) // <-- Notice this check
add_meta_box(
'postimagediv',
esc_html( $post_type_object->labels->featured_image ),
'post_thumbnail_meta_box',
null,
'side',
'low'
);
Note that if you later try to add the option:
'upload_files' => true
to your add_role()
setup, it might not update, since it’s cached in the wp_user_roles
option.
You therefore need to update the database to adjust it:
- use
remove_role()
and thenadd_role()
again, - use the
add_cap()
method of the\WP_Role
class.
It might also be possible to use filters like user_has_cap
to adjust this dynamically.
Related Posts:
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- How come Featured Image isn’t showing up in my Custom Post Type?
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- add_image_size() for specific Post Types
- How to disable generation of default image sizes for some custom post types?
- Custom post type role permissions won’t let me read
- Allowing custom role access to custom post type in back end
- Using add_theme_support inside a plugin
- Restrict Contributors to view only their own custom post types?
- Why does my custom WP role need edit_posts to edit images?
- Make featured image required
- How to remove “featured image” functionality from a custom post type?
- How to assign specific users the capability to edit specific pages / posts / custom post types
- Featured Image Panel Missing From Custom Post Type in WordPress 3.2
- Allow user to Edit Posts but not Add New?
- Defining capabilities for custom post type
- Assign a Custom Role to a Custom Post?
- Restrict custom post type view by user role
- Creating custom user roles
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- set_post_thumbnail_size in percent, not pixels?
- Best way to filter featured image text for a custom post type?
- Can I make user role that can only access a certian content type?
- Associating an “author” with a custom taxonomy
- If featured image doesn’t exist, show post content
- Create user role restricted to specific CPT
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- User roles – enable custom posts disable posts
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- How to not allow custom roles to edit published custom post types?
- set and unset the custom field value
- How I upload, save and set a featured image from my frontend?
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- How can I get the last posts by user role?
- How do I code access to the built-in UI of a CPT when it’s placed as submenu of another CPT that is protected by role?
- Custom user role not working as expected
- Trouble adding custom featured image for custom taxonomy TERMS
- How can i place Feature Image under title field in wp-admin?
- Which User Role for Custom Post Type Menu – wp_nav
- Adding capabilities to default roles
- How to remove thumbnail sizes for specific post type on a child theme?
- Featured image metabox not showing up
- image srcset returns false
- How to use different featured image size for a custom post type?
- get_the_post_thumbnail() returning empty string on custom post type
- Change admin post thumbnail size for custom post type only
- grant a privilege for roles (for example editors) and higher
- Prevent author role from editing all posts in custom post type?
- How to add multiple featured image in meta box in post editor?
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Custom Role can’t trash Custom Post Type
- Limit access to page depending on user level
- Role Capabilities: Add New Ones?
- Why does current_user_can(‘edit_posts’) return true, but current_user_can(‘edit_post’, $post->ID) returns false?
- How to publish custom post type for custom role user and not “submit for review”?
- How to List Thumbnails based on Custom Categories
- reference the current category being used in the category.php page
- add_image_size for post type
- Prevent authors from creating new posts of specific custom-post-type
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Registration and Custom Post Types – How to synchronize information?
- Limit users by custom taxonomy and user roles
- Add custom capabilities to existing custom post type
- allow edit of custom post type but not regular posts?
- Allow Administrator role access to custom capabilities [duplicate]
- using add_role function to make some users to create a selected type post
- How to enable a custom post type to custom user role in WordPress
- Change post featured image on hover
- Why is my Custom Post Type not showing up after adding capabilities?
- Show Post Thumbnail In Custom Post From Other CPT
- is there a way to retrieve posts that do not have a featured image assigned?
- Cannot attach media when capabilities added to custom post type
- get custom post type thumbnail
- Using global $post; to get featured image for custom post via WP_Query
- Displaying media for custom post type
- Custom Image Thumbnails of Different Sizes
- After adding add_role to functions.php and creating a user, can not login into admin
- How to change post featured image using a custom field of category?
- Force documents to appear in Featured Image dialogue
- Restrict user to only one custom post type
- Change Featured Image / Thumbnail CMS Description
- only a certain role has access to a cpt
- Featured Images does not show in custom post type
- Loading custom post thumbnail into stream
- Is it possible to show full content of the post when there is only one post in a grid?
- How to restrict CPT post’s fronted view only for specific user roles?
- current_user_can() return FALSE but debugging says TRUE
- Role capability delete multiple post type posts doesn’t work
- How to set YouTube video as featured image?
- How to allow a custom user role to create, edit, delete a specific custom post type only?
- Display content based on a users login
- map_meta_cap woes
- Link to full size post thumbnail
- Roles for Custom Post Types
- Role scoping for contributors down to the field level
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- can’t see custom post content filtered under “mine” filter in admin panel
- Define new user capability for custom post types?