Faulty 'capability_type' argument
Support › MB Custom Post Type › Faulty 'capability_type' argumentResolved
- This topic has 4 replies, 3 voices, and was last updated 3 years, 8 months ago by
Long Nguyen.
-
AuthorPosts
-
March 26, 2021 at 4:49 PM #26724
Antonius CezarHegyes
ParticipantHello!
I've used the UI to register a CPT with WordPress and I set the capability type to 'custom'. According to the documentation (https://docs.metabox.io/extensions/mb-custom-post-type/), that should set the 'capability_type' to
array( 'plugin-product', 'plugin-products' )
(since my slug is plugin-product) but it simply sets it tocustom
instead.This is the value of the post_content attribute saved into the database:
{"slug":"plugin-product","function_name":"your_prefix_register_post_type","text_domain":"your-textdomain","label":"Plugin Products","labels":{"name":"Plugin Products","singular_name":"Plugin Product","add_new":"Add New","add_new_item":"Add new plugin product","edit_item":"Edit Plugin Product","new_item":"New Plugin Product","view_item":"View Plugin Product","view_items":"View Plugin Products","search_items":"Search Plugin Products","not_found":"No plugin products found","not_found_in_trash":"No plugin products found in Trash","parent_item_colon":"Parent Plugin Product:","all_items":"All Plugin Products","archives":"Plugin Product Archives","attributes":"Plugin Product Attributes","insert_into_item":"Insert into plugin product","uploaded_to_this_item":"Uploaded to this plugin product","featured_image":"Featured image","set_featured_image":"Set featured image","remove_featured_image":"Remove featured image","use_featured_image":"Use as featured image","menu_name":"Plugin Products","filter_items_list":"Filter plugin products list","items_list_navigation":"Plugin products list navigation","items_list":"Plugin Products list","item_published":"Plugin Product published","item_published_privately":"Plugin product published privately","item_reverted_to_draft":"Plugin product reverted to draft","item_scheduled":"Plugin Product scheduled","item_updated":"Plugin Product updated"},"description":"","public":true,"hierarchical":false,"exclude_from_search":false,"publicly_queryable":true,"show_ui":true,"show_in_menu":true,"show_in_nav_menus":true,"show_in_admin_bar":true,"show_in_rest":true,"rest_base":"","menu_position":20,"menu_icon":"dashicons-store","capability_type":"custom","supports":["title","editor","thumbnail","revisions"],"taxonomies":[],"has_archive":true,"archive_slug":"","rewrite":{"slug":"","with_front":false},"query_var":true,"can_export":true,"delete_with_user":true}
I went through the 'PostTypeRegister.php' file in case there was some post-processing taking place before registering the post type with WordPress, but it's being passed on 1-to-1. Because of this, the custom capability feature it broken.
Thank you!
March 26, 2021 at 9:15 PM #26732Long Nguyen
ModeratorHi Antonius,
Thank you for your feedback.
We did aware of this issue and the development team is working tirelessly to ship a fix as soon as possible.
March 27, 2021 at 8:43 PM #26744Antonius CezarHegyes
ParticipantAwesome! Thank you, Long!
August 12, 2021 at 6:23 AM #30167Andrew Ibarra
Participanthas this been fixed?
August 12, 2021 at 2:11 PM #30187Long Nguyen
ModeratorHi,
This issue has been fixed. We've also created a note when creating a new CPT and select Capability Type: Custom
If select custom capability, make sure to add capabilities to admin or other roles to add or edit posts of this type (using a plugin like Members or User Role Editor).
-
AuthorPosts
- You must be logged in to reply to this topic.