• We have developed Offers for WooCommerce plugin. Now we want to make an extension which shows all offers of products owns by the vendors created by YITH multi vendors plugin. So the issue is that if I register with vendors I don’t see my custom post type “manage offers” even I assign all the capabilities to that user role or users. Can you please help me how I can allow access to my custom post type for the users with vendor role? It shows me error “Invalid post type.” for vendors.

    Please see the detailed description at https://stackoverflow.com/questions/42242274/my-custom-post-type-is-not-showing-for-the-yith-vendor-user-roles

    Please help. Thanks in advance.

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi @gandhirk,

    I read the topic on stackoverflow. In this way you add the caps to vendor role but our plugin remove all menu items for other CPT.
    The only way are to add again the menu item(s) you want to show for vendors.

    You can try to add an action to admin_menu with priority set to 15 or greather and add again the menu item, with add_menu_page, if the current user has vendor role.

    After that, in multivendor plugin you find this add_action in class.yith-vendors-admin.php:

    add_action( 'current_screen', array( $this, 'disabled_manage_other_vendors_posts' ) );

    You need to create a method at init action, with priority set to 15 or greather, to remove this and create a new function to add the check control for your CPT.

    At line 416 of this file htdocs/wp-content/plugins/yith-woocommerce-multi-vendor.premium/includes/class.yith-vendors-admin.php you find a code that stop the vendor access to some post types, in fact vendor can access only to their product and their shop_order, you must add this check for your CPT in order to prevent to edit CPT of other vendors.

    Have a nice day
    YITH

Viewing 1 replies (of 1 total)
  • The topic ‘My custom post type is not showing for the yith vendors’ is closed to new replies.