Are you using Jetpack on your website? I do, and if you are not, you should!
I want to show you a single module in this article, the Contact form module. It adds the ability for who has access to the Dashboard to add contact forms to posts, and recently to products in WooCommerce.
When enabling this module, you will see a button like this on products, before the content editors:
This is cool, you can use the contact form to create a Product enquiry form, or something else, but you might not want the button to be available for everyone. The problem occurs when using plugins who give access to manage products like WooCommerce Product Vendors.
Product Vendors allows vendor admins to log in the Dashboard to manage products. They will see, by default, the contact form button as well. How to disable it?
With a snippet, obvious no?
Add this code at the end of the file functions.php in wp-content/themes/your-child-theme-name/:
Notice on line 3 I use the capability
manage_woocommerce to allow only administrators and shop managers to see the button. If you want it to be available only to administrators, change it to