Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter eduardasm

    (@eduardasm)

    Thanks for quick reply. I was using Custom Post Type UI plugin for creating custom post type, but it does not offer to customize capabilities. Then I have registered it manualy:
    add_action(‘init’, ‘register_company_post_type_function’);
    function register_company_post_type_function() {
    $labels = array(
    ‘name’ => __(‘Companies’, ”),
    ‘singular_name’ => __(‘Company’, ”),
    );
    $args = array(
    ‘label’ => __(‘Companies’, ”),
    ‘labels’ => $labels,
    ‘description’ => ”,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘show_ui’ => true,
    ‘show_in_rest’ => false,
    ‘rest_base’ => ”,
    ‘has_archive’ => ‘imones’,
    ‘show_in_menu’ => true,
    ‘exclude_from_search’ => false,
    ‘hierarchical’ => false,
    ‘rewrite’ => array( ‘slug’ => ‘imone’, ‘with_front’ => true ),
    ‘query_var’ => true,
    ‘supports’ => array( ‘title’, ‘editor’, ‘thumbnail’, ‘excerpt’, ‘author’ ),
    ‘taxonomies’ => array( ‘heading_category’, ‘company_category’, ‘company_country’ ),
    ‘capability_type’ => ‘company’,
    ‘capabilities’ => array(
    ‘edit_post’ => ‘edit_company’,
    ‘edit_posts’ => ‘edit_companys’,
    ‘edit_published_post’ => ‘edit_published_company’,
    ‘edit_published_posts’ => ‘edit_published_companys’,
    ‘edit_other_post’ => ‘edit_published_company’,
    ‘edit_other_posts’ => ‘edit_published_companys’,
    ‘edit_private_post’ => ‘edit_private_company’,
    ‘edit_private_posts’ => ‘edit_private_companys’,
    ‘create_post’ => ‘create_company’,
    ‘create_posts’ => ‘create_companys’,
    ‘publish_post’ => ‘publish_company’,
    ‘publish_posts’ => ‘publish_companys’,
    ‘copy_post’ => ‘copy_company’,
    ‘copy_posts’ => ‘copy_companys’,
    ‘delete_post’ => ‘delete_company’,
    ‘delete_posts’ => ‘delete_companys’,
    ‘delete_published_post’ => ‘delete_published_company’,
    ‘delete_published_posts’ => ‘delete_published_companys’,
    ‘delete_other_post’ => ‘delete_other_company’,
    ‘delete_other_posts’ => ‘delete_other_companys’,
    ‘delete_private_post’ => ‘delete_private_company’,
    ‘delete_private_posts’ => ‘delete_private_companys’,
    ),
    ‘map_meta_cap’ => true,
    );
    register_post_type(‘company’, $args);
    }

    Using Members plugin I’ve created role Manager and granted following capabilities for Companies:
    edit_company
    edit_companies
    edit_published_company
    edit_published_companies
    publish_company
    publish_companies

    For Administrator I’ve granted all.

    After doing this, logged in as Manager I could see Companies on admin menu, but still could not access edit.php?post_type=company page. Only after I granted edit_posts capability to Members I could access this page, but at the same time Manager got access to Posts and Tools admin menu. How can I hide these from Managers – they should see only Companies and Profile.

    Just to confirm, that 1.5.0.2 version throws Fatal error:
    Fatal error: Class ‘Caldera_Forms_Sync_Factory’ not found

Viewing 2 replies - 1 through 2 (of 2 total)