• Hello. I need to restrict access to the CPT through capabilities. But does not matter in which way i have registered this CPT there no new capabilities appears in the list.
    Can you please point me out how to do that?
    1. I’ve tried CPT UI
    2. Manually – add_action( 'init', 'create_sites_content_cpt', 5 );
    with capability_type and map_meta_cap
    3. I’ve look at woocommerce, how they do it, and repeat it in my theme/plugin but have no luck.
    Any ideas please?

Viewing 1 replies (of 1 total)
  • Thread Starter Alexey Svidentsov

    (@hector_ua)

    Figured out.
    Need to add all caps manually to admin at first, and then control in via aam.
    $role = get_role('administrator'); $role->add_cap($cap);
    Isn’t there a way to get all not assigned caps dynamically? For example: get_post_type_capabilities()

Viewing 1 replies (of 1 total)
  • The topic ‘Add CPT Capabilities’ is closed to new replies.