Hiding "Custom Capability" in "Add Staff" tab

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 – Groups & Staffs Hiding "Custom Capability" in "Add Staff" tab

Viewing 10 reply threads
  • Author
    Posts
    • #19999
      Jin
      Guest

      Hi,

      I want to have vendors to create/manage their staffs, but I don’t want vendors to set staff’s capability.
      Is there any way to hide “custom capability” checkbox/fields in “Add Staff” tab?

      Thank you.

    • #20006
      WCFM Forum
      Member

      Hi Jin,

      There is no settings for the purpose but you may achieve this using this code snippet –

      function wcfm_staff_manager_fields_manupulation( $staff_fields ) {
      	if( isset( $staff_fields['has_custom_capability'] ) && wcfm_is_vendor() ) {
      		$staff_fields['has_custom_capability']['class'] = 'wcfm_ele_hide';
      		$staff_fields['has_custom_capability']['label_class'] = 'wcfm_ele_hide';
      	}
      	return $staff_fields;
      }
      add_filter( 'wcfm_staff_manager_fields_general', 'wcfm_staff_manager_fields_manupulation' );

      Just add this code to your site theme functions.php

      Please know me is this works for you or not!

      Thank You

    • #20012
      Jin
      Guest

      Thanks for your help, the code works perfectly!

      Does this mean that I can add below code to make ‘username’ field to disappear?
      $staff_fields[‘user_name’][‘label_class’] = ‘wcfm_ele_hide’;
      $staff_fields[‘user_name’][‘class’] = ‘wcfm_ele_hide’;

      Thank you.

    • #20031
      Jin
      Guest

      And is it possible to add {vendor_name} and {email} (that vendor used to register) in email notification form, other than {site_url}, {user_role}, {username}, {first_name}, {password}?

    • #20035
      Bingal
      Member

      Hi,

      If you hide ‘user_name’ then Staff can not be created, it’s required field to add a Staff.

      Can you please know me, which email notification your are talking about?

      Thank You

    • #20041
      Jin
      Guest

      I’m referring to new staff creation email form, the last image on this knowledgebase site https://wclovers.com/knowledgebase/wcfm-groups-staffs/

      Thanks

    • #20043
      WCFM Forum
      Member

      Hi,

      Thanks for the clarification.

      This email goes to newly created Staff user with his account details.

      Why vendor details should be here?

      Thank You

    • #20046
      Jin
      Guest

      Im thinking of having multi-vendors taking care of their own staffs. Was just curious if it is possible to do so.

    • #20048
      WCFM Forum
      Member

      Hi,

      Yes off course, vendor may have there own staffs.

      In fact, staff custom capability was there to enhance this, vendor will able to assign different role to different staffs – one to product and another to order etc…

      Thank You

    • #20050
      Jin
      Guest

      Okay, I will look more into it.

      Thanks for all your help.

    • #20069
      Bingal
      Member

      Yeah sure … please know me if you required any further assistance on this.

Viewing 10 reply threads
  • The topic ‘Hiding "Custom Capability" in "Add Staff" tab’ is closed to new replies.