Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Can’t publish custom post type – “You are not allowed to edit this post.”

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:

  1. How do I remove all the metaboxes for a custom post type?
  2. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  3. Get all posts from custom post type and insert in select input as metabox
  4. Detect meta value changes when post is updated (post_updated)
  5. Having trouble with custom post type / meta box
  6. How can I include meta box content when searching?
  7. update a post meta from a single table cell TablePress
  8. update custom post type meta from a shortcode
  9. Custom Meta Boxes – Nonce Issue – Move to trash issue
  10. Displaying Meta Box Image
  11. How to keep a check box in custom meta box for custom post type checked by default for add new post?
  12. How to add multiple featured image in meta box in post editor?
  13. Show metabox in custom-post-template depending on taxonomy term?
  14. Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
  15. Displaying custom posts only if custom meta box’s date is not expired
  16. Displaying Metabox value (custom post type taxonomy)
  17. How can I display my custom metaboxes on a custom post template?
  18. Meta Box Only in CPT Edit Page, Not in Add New
  19. get_post_meta is returning image id
  20. Populate Custom Fields in a Custom Post Type?
  21. Custom meta box data array: foreach not working correctly?
  22. Undefined Variable – Custom Post Type Meta
  23. Populate dropdown from one custom post type inside another custom post type
  24. How to check if user meta field is empty in conditional else statement
  25. A better way to add a meta box to custom post types
  26. Metabox not show in categories custom post type cmb2
  27. Show Custom Post Type meta boxes only on Page Edit
  28. How can I move (or create another) publish button?
  29. Meta Data for Custom Post Type not saving
  30. Get only used meta_values
  31. create custom meta box with default value
  32. Displaying a div from an assigned meta_value when on a page
  33. How to Echo Metadata Value in Currency Format
  34. Issue on Working with Metabox – Checkbox to enable Sale Items
  35. Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
  36. Why do I have to press the “Update” button twice to save my meta box values?
  37. Values from meta-box not on $_POST
  38. Custom post type suddenly stoped working after WordPress 5 update
  39. How can I output WPAlchemy repeating fields meta values in my page template?
  40. Meta box data is saved but NOT displayed in the meta box text field. Why?
  41. Save Metabox Custom Field Value
  42. Meta box data not saving
  43. WP_Meta_Query object with conditionals
  44. Related posts meta_query CPT
  45. Meta box with front-end styling
  46. Sanitaizing Select Optin For Custom Post Type Metabox in WP
  47. How to retrive Custom Post Type Meta Fields in Custom WP_Query
  48. Cannot Save MetaBox Data in Custom Post Type
  49. Add a class to post_class if more than one post shares same meta_value_num
  50. Function to return values from metabox
  51. Add a meta field to the list of results for a custom post type
  52. Empty meta-box returns publishdate if no value is set?
  53. Custom Meta Box with variable number of fields
  54. Publish box in CPT remove ‘edit’ link
  55. Custom Post Type meta data getting deleted on bulk editing taxonomies
  56. Modify Publish Metabox location on CPT
  57. Get meta values from parent post and save in child post
  58. Metaboxes in Loop
  59. Custom meta box data not saving
  60. Collect custom post in a calendar
  61. Delete custom post type metadata without deleting the post in admin area
  62. Disable Facebook Comments Automatically On CPT
  63. Problem with ‘save_post’ hook not running
  64. Edit post meta direct from post.php?
  65. Howto: use existing post_meta as options for a different metabox (checkboxes or list)
  66. Display a post count from a custom metabox selection
  67. Post AND page parameter for WP function
  68. Use a Variable in update_post_meta as the $meta_key
  69. Create a Dropdown from Custom Post Type
  70. Translating custom post type metaboxes [closed]
  71. Adding a metabox on a CPT’s submenu page
  72. Custom filter function not working with Custom post type
  73. Fixed values for same post translations
  74. How to Add multiple instance of meta box to custom post type
  75. Using POST method in meta box, no results
  76. meta box on custom post type
  77. Checking if $_FILE isset for an array of file upload metaboxes
  78. Importing Data from a Non-WordPress database, into WP
  79. Ordering values entered in Custom Taxonomies
  80. Getting thumbnails of a custom posts featured images in a page-templates metabox
  81. Listing custom terms in custom post meta
  82. Permalinks: custom structure for taxonomy – tags?
  83. List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
  84. Custom Post Type & Meta Box – Displaying meta box information on front end?
  85. Remove Post Custom Meta Box
  86. Wrap meta boxes & data handling for specific post types in classes?
  87. Can custom fields be added without a meta box?
  88. Meta Box on Custom Post Type not saving
  89. Custom fields for custom post type
  90. Show future events based on custom field AND order by date
  91. Custom “radio button meta box” not saving correctly
  92. Global custom meta box
  93. Sizing textarea field in custom metabox
  94. Moving meta boxes in admin
  95. Remove “show sharing buttons” metabox Jetpack from custom post type
  96. Using preg_replace to filter custom textarea
  97. Add additional field to custom post_type
  98. Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
  99. Custom Post Meta from custom metaboxes is randomly being deleted
  100. Check if post with same meta value exists
Categories custom-post-types Tags custom-post-types, metabox, post-meta, publish
Query based on custom fields start and end date
Multi Upload In Theme Options

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress