• Resolved Make carlos

    (@make-carlos)


    Hi
    How can we add one more custom post type to vendor dashabord. I mean from wp-admin profile vendor can see CPT like: drops.

    I have tried something like this based on core file. I have added filter in function.php

    function add_new_cpt_to_vendor($capabilities) {
    
            $capabilities = array(
                    'drops'   => array(
                    'wcv_add_drops'            => __( 'Add drops', 'wc-vendors' ),
                    'wcv_edit_drops'           => __( 'Edit drops', 'wc-vendors' ),
                    'wcv_edit_drops_published' => __( 'Edit published drops', 'wc-vendors' ),
                    'wcv_publish_drops'        => __( 'Publish drops directly without approval', 'wc-vendors' ),
                    'wcv_delete_drops'       => __( 'Delete drops', 'wc-vendors' ),
                    'wcv_duplicate_drops'      => __( 'Duplicate drops', 'wc-vendors' ),
                    'wcv_featured_drops'       => __( 'Featured drops', 'wc-vendors' ),
                    'wcv_view_drops'           => __( 'View drops', 'wc-vendors' ),
                    'wcv_import_drops'         => __( 'Import drops', 'wc-vendors' ),
                    'wcv_export_drops'         => __( 'Export drops', 'wc-vendors' )
                ),
            );
    
            return $capabilities;
    
        }
    
        add_filter('wcv_get_vendor_caps', 'add_new_cpt_to_vendor');

    but its not showing under vendor profile in backend. Also have tried with User role editor and i can see all caps are there but still not showing.

    Please advice.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Carlos,

    This will not work because vendors don’t have capabilities to create posts and pages (custom posts included).

    They only have the capability to create, edit, and delete products.

    You will have to include the capability to create, edit and delete custom posts.

    Cheers,
    Lloyd

    Thread Starter Make carlos

    (@make-carlos)

    Hi,

    Thank you for your reply. I have asked question about adding custom post type using filter.

    Thanks
    Make

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom post type need to show vendor profile’ is closed to new replies.