Jump to content

fabianschultz

New Members
  • Posts

    1
  • Joined

  • Last visited

fabianschultz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I am trying to hide a specific search form field based on Wordpress user role but I am missing somehting, it does not hide the field: add_filter ('bps_before_search_form_filter' , 'hide_field_19_wrap', 10, 1); $array1 = array(field_19_wrap, field_28_match_any_wrap, field_34_distance_wrap); function hide_field_19_wrap ($field_ids){ global $current_user; $user_roles = $current_user->roles; if (!current_user_can('subscriber')) { unset($array1[field_19_wrap]); } Return $field_ids; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.