Viewing 1 reply thread
  • Author
    Posts
    • #7542
      buishi
      Member

      I have a custom post type that I’ve declared with custom capabilities:

      ,'capability_type' => array('plagiarism_case', 'plagiarism_cases')
       ,'map_meta_cap' => true

      Then 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!

    • #7561
      Steve
      Keymaster

      Are you registering the post type with the Piklist filter or WordPress function?

Viewing 1 reply thread
  • You must be logged in to reply to this topic.