A deal you can't resist! Get upto 35% Off on this entire cyber week.
We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.
Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › How do I get current user's vendor ID?
Tagged: functions, variables
For my custom post types, I need to be able to attribute the current user’s vendor ID.
What is the best way to get the current user’s vendor ID?
Also, is there a call like is_vendor()?
Vendors are normal WP users.
So you may get vendor id using WP default current user function – get_current_user_id()
You may check logged in user vendor or not using this WCFM function – wcfm_is_vendor()
You may use this function to check any user whether he is vendor or not, then you have to pass user id in this function – wcfm_is_vendor( $user_id )
wcfm_is_vendor( $user_id )