Tagged: capabilities, field, metabox
- This topic has 1 reply, 2 voices, and was last updated 5 years, 2 months ago by
Steve.
Viewing 1 reply thread
-
AuthorPosts
-
-
November 15, 2016 at 7:59 pm #7542
buishiMemberI have a custom post type that I’ve declared with custom capabilities:
,'capability_type' => array('plagiarism_case', 'plagiarism_cases') ,'map_meta_cap' => trueThen I have the capabilities defined:
$admin_caps = array( 'edit_others_plagiarism_cases', 'delete_others_plagiarism_cases', ); $user_caps = array( 'edit_plagiarism_cases', 'read_plagiarism_case', 'delete_plagiarism_case', 'edit_plagiarism_cases', 'publish_plagiarism_cases', 'read_private_plagiarism_cases', 'read', 'delete_plagiarism_cases', 'delete_private_plagiarism_cases', 'delete_published_plagiarism_cases', 'edit_private_plagiarism_cases', 'edit_published_plagiarism_cases', 'create_plagiarism_cases', ); $admin_roles = array( get_role( 'administrator' ), get_role( 'editor' ), ); $user_roles = array( get_role( 'subscriber' ), get_role( 'contributor' ), ); foreach ($admin_roles as $role) { foreach (array_merge($admin_caps, $user_caps) as $cap) { $role->add_cap( $cap ); } }; foreach($user_roles as $role){ foreach ($user_caps as $cap) { $role->add_cap( $cap ); } };Unfortunately, only admins appear to be able to save values in the metaboxes. Subscribers can edit the post type, and even edit the meta fields directly (via native wordpress field display), but when entering information in the metabox field, the content is not saved. The same is true of the front-end form.
I’m using piklist 0.9.9.9
Thanks in advance!
-
November 18, 2016 at 12:49 am #7561
SteveKeymasterAre you registering the post type with the Piklist filter or WordPress function?
-
-
AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.