Hide "Preview" button for vendors only. Keep it available to admin.

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Product HUB Hide "Preview" button for vendors only. Keep it available to admin.

Viewing 1 reply thread
  • Author
    Posts
    • #92633
      AvatarBizWizMarketing
      Participant

      How can I hide the “Preview” button for vendors ONL?

      I tried this, but it will remove the “Preview” to the entire site include the admin.
      add_filter( ‘wcfm_is_allow_product_preview’, ‘__return_false’ );

    • #93115
      AvatarSushobhan
      Keymaster

      Hi,
      The hook is correct, all you need is to additionally check for the vendor role.

      function disallow_vendor_product_preview($cap) {
          if(wcfm_is_vendor()) return false;
          return $cap;
      }
      add_filter( 'wcfm_is_allow_product_preview', 'disallow_vendor_product_preview' );

      Let me know if there’s anything else we can help you with.

Viewing 1 reply thread
  • The topic ‘Hide "Preview" button for vendors only. Keep it available to admin.’ is closed to new replies.