The default for map_meta_cap
is actually not false if you’re also passing in a capability_type
of post
or page
, which you are.
The following code is in WordPress Core’s post.php:
// Back compat with quirky handling in version 3.0. #14122
if ( empty( $args->capabilities ) && null === $args->map_meta_cap && in_array( $args->capability_type, array( 'post', 'page' ) ) )
$args->map_meta_cap = true;
So by explicitly setting it to false, you were telling it not to use the capabilities of a post
or page
.
By not setting it at all, you allowed the above code to set it to true.
Code just a few lines down, get_post_type_capabilities uses this flag for whether or not to use the default posts capabilities which gives you the permissions you’re looking for.
Related Posts:
- How do I remove all the metaboxes for a custom post type?
- How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
- Get all posts from custom post type and insert in select input as metabox
- Detect meta value changes when post is updated (post_updated)
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How can I display my custom metaboxes on a custom post template?
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- Populate Custom Fields in a Custom Post Type?
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- A better way to add a meta box to custom post types
- Metabox not show in categories custom post type cmb2
- Show Custom Post Type meta boxes only on Page Edit
- How can I move (or create another) publish button?
- Meta Data for Custom Post Type not saving
- Get only used meta_values
- create custom meta box with default value
- Displaying a div from an assigned meta_value when on a page
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Why do I have to press the “Update” button twice to save my meta box values?
- Values from meta-box not on $_POST
- Custom post type suddenly stoped working after WordPress 5 update
- How can I output WPAlchemy repeating fields meta values in my page template?
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Save Metabox Custom Field Value
- Meta box data not saving
- WP_Meta_Query object with conditionals
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Meta Box with variable number of fields
- Publish box in CPT remove ‘edit’ link
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Modify Publish Metabox location on CPT
- Get meta values from parent post and save in child post
- Metaboxes in Loop
- Custom meta box data not saving
- Collect custom post in a calendar
- Delete custom post type metadata without deleting the post in admin area
- Disable Facebook Comments Automatically On CPT
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Display a post count from a custom metabox selection
- Post AND page parameter for WP function
- Use a Variable in update_post_meta as the $meta_key
- Custom Post Type Meta Boxes
- Dynamically add / duplicate custom meta in custom post types
- Insert Multiple Post with Same Publish Button
- Cannot save Checkbox meta box value from a Custom Post Type
- Post image in WordPress not appearing on home page
- How to make custom taxonomy into drop down select in a custom metabox
- Show future events based on custom field AND order by date
- Global custom meta box
- How to move a post to different post type with all meta data?
- Forms and WordPress Nonce
- WP API Response does not show my registered metadata
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- Creating alternate meta box context locations
- How to call a post’s metadata in shortcode.php?
- Custom meta box in custom post type not working
- Trying to write shortcode with get_post_meta but isn’t working
- I can’t connect my custom jquery to wp admin
- Saving meta box data?
- updating one custom meta field only
- Include a metabox in the ‘home’ screen of a custom post type? If not, then the dashboard page?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Custom metabox with image gallery upload that won’t attach images to post
- Wp Query sort order from custom MetaBox
- How to retrieve custom post type permalink in another cpt?
- Edit is changing my custom’s post type parent id
- Search form to find custom meta box generated data
- WordPress custom post type
- Yearly Archive from a custom date metabox (Event Start Date)
- Custom post type – update_meta not working
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- CPT Template Option to Top
- Cannot change meta box position