• Resolved mostafashenawy86

    (@mostafashenawy86)


    I created a custom post type using the arguments below, and wanted a WP custom user role ( vendor ) to view/edit it on back-end.

    I gave that user role the appropriate capabilities to do so, but it didn’t appear, I tried to investigate this, I figured out that when I grant the user vendor role manage_woocommerce capability, CPT appear on vendor users back-end.

    But granting ( vendor ) user role that capability causes another side affects.

    Screenshot showing menu items with woocommerce plugin deactivated, and CPT appear

    View post on imgur.com

    Screenshot showing menu items with woocommerce plugin activated, and CPT isn’t exist.
    https://i.stack.imgur.com/ZG696.jpg

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    Thread Starter mostafashenawy86

    (@mostafashenawy86)

    These are arguments used to create CPT mentioned above

    $labels = array(
    ‘name’ => ‘Franchisee coaches’,
    ‘singular_name’ => ‘Franchisee coache’,
    ‘menu_name’ => ‘Franchisee coaches’,
    ‘name_admin_bar’ => ‘Franchisee coache’,
    ‘add_new’ => ‘Add New’,
    ‘add_new_item’ => ‘Add New Franchisee coache’,
    ‘new_item’ => ‘New Franchisee coache’,
    ‘edit_item’ => ‘Edit Franchisee coache’,
    ‘view_item’ => ‘View Franchisee coache’,
    ‘all_items’ => ‘All Franchisee coaches’,
    ‘search_items’ => ‘Search Franchisee coaches’,
    ‘parent_item_colon’ => ‘Parent Franchisee coaches:’,
    ‘not_found’ => ‘No Franchisee coaches found.’,
    ‘not_found_in_trash’ => ‘No Franchisee coaches found in Trash.’,
    );

    $args = array(
    ‘labels’ => $labels,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘show_ui’ => true,
    ‘show_in_menu’ => true,
    ‘menu_icon’ => ‘dashicons-id-alt’,
    ‘query_var’ => true,
    ‘rewrite’ => array( ‘slug’ => ‘franchisee-coaches’ ),
    ‘capability_type’ => array(‘franchisee_coach’, ‘franchisee_coaches’),
    ‘map_meta_cap’ => true,
    ‘has_archive’ => true,
    ‘hierarchical’ => false,
    ‘menu_position’ => 40,
    ‘supports’ => array( ‘title’, ‘thumbnail’ )
    );

    register_post_type( ‘franchisee-coaches’, $args );

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    As no one has been able to jump in and help, you’ll need to work with a developer to take this further. In that case, I highly recommend contacting one of the services on our customizations page: https://woocommerce.com/customizations/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce prevent WP users custom role from viewing CPT on dashboard’ is closed to new replies.