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
- 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?
- How to disable generation of default image sizes for some custom post types?
- Custom post type role permissions won’t let me read
- 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?
- Restrict custom post type view by user role
- Confusion with adding meta capabilities to a role after registering a Custom Post Type with corresponding ‘capability_type’ parameter
- 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 not allow custom roles to edit published custom post types?
- set and unset the custom field value
- How can I get the last posts by user role?
- 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
- Change admin post thumbnail size for custom post type only
- grant a privilege for roles (for example editors) and higher
- Role Capabilities: Add New Ones?
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Add custom capabilities to existing custom post type
- allow edit of custom post type but not regular posts?
- using add_role function to make some users to create a selected type post
- Why is my Custom Post Type not showing up after adding capabilities?
- Using global $post; to get featured image for custom post via WP_Query
- Displaying media for custom post type
- How to change post featured image using a custom field of category?
- Restrict user to only one custom post type
- Change Featured Image / Thumbnail CMS Description
- only a certain role has access to a cpt
- Is it possible to show full content of the post when there is only one post in a grid?
- current_user_can() return FALSE but debugging says TRUE
- map_meta_cap woes
- Link to full size post thumbnail
- Roles for Custom Post Types
- Role scoping for contributors down to the field level
- can’t see custom post content filtered under “mine” filter in admin panel
- Define new user capability for custom post types?
- WordPress multiple custom post types capability conflict in a single menu
- Giving permission to anyone (non-users as well) with a password to edit a post, possible?
- Allow Contributor to edit but not update a published post
- Users create/join groups
- “Submit for review” for updates on existing posts
- Allow add new post access to custom post but not wp post for some role
- unable to show custom post type featured image
- Create custom post with custom user rules
- How to show featured image block in custom post type for Author?
- Want to be able to sign up subscribers as authors
- how to post default thumbnail if post not created yet
- Set featured image to archive.php
- Post-thumbnail only for specific post-types?
- Featured image size in column
- 3 random images from custom post type, each in a div with a diffrent class
- how to associate several authors to a custom post type
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Select other roles as custom post authors
- Dynamic pages for linked categories and content
- Preventing role reading others posts
- Cannot upload featured image to a custom post type
- Enable comments for post when comments meta box removed
- Roles and Capabilities in Custom Post Types
- Add Permalink to Post Thumbnail, syntax code issues
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Change user role when user’s first post gets published
- Clone wp-admin/users.php (Users Admin Page)
- Put featured image under post title in admin area
- Added new role with custom capability. But cannot access the page
- Restrict admin pages for specific user role
- Conditional editing CPT – using editor’s role and author’s usermeta
- Remove plugin settings from post creation page for a user role
- Allowing custom role user to edit post assigned to them but don’t let them create new custom type post
- I want to show post details based on roles user login
- Instructor can view, edit, delete only theirs courses
- Front-end submitted post is published with admin ID as author
- WooThemes – Vendors / Bookings – Allow Vendors to manage resources
- Front End users account with lots of user Roles (not Woocommerce)
- Display featured images from custom post type in the homepage template
- Add featured image programatically to custom post type
- How To Loop Through list with Custom Post Types
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Custom Post Type only display items created by user
- Add role privileges of the custom post type
- Prevent author role from editing others posts
- creating different edit screens for different roles
- CPT, Custom User Role and problem with user manager
- Display and Allow users to edit their own profiles
- Custom Post Type supports author
- Featured image in admin on custom post type
- Capability to read user’s own draft post of CPT
- Custom post type & role issues
- Custom role can’t create permalink
- Read-Only custom post type
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- WordPress Roles
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?