Hide Admin Account From Vendor List In Dokan Backend
Dokan Multivendor plugin has a cool feature to show all the vendor list on the WordPress Backend -> Dokan -> Vendors area. Where the site admin can easily edit any vendor information, banner image, or profile image.
Now, the main problem is the vendor list is not only showing a vendor account. It is also showing all the administrator account too. So, if your website has 5 admins and 20 vendors then on the vendor list it is showing 25. Arggh! sometimes you might get confused that how come I have 25 vendors while the User list is showing 20 :/
How to hide admin account from the vendor list?
You need a child theme’s functions.php or use PHP inserter plugin to use the below code
function exclude_some_sellers_users( $seller_args ) {
$seller_args['role__in'] = array( 'seller' ); // add here roles
return $seller_args;
}
add_action( 'dokan_rest_get_stores_args', 'exclude_some_sellers_users', XX );
Replace XX with the admin's User ID
This solution is found here
Last updated