Forums Forums Search & Filter Pro Customize Value Postfix

Viewing 10 posts - 11 through 20 (of 24 total)
  • Trevor
    #214927

    It shouldn’t have the dollar symbol, no.

    I can see an error also, so try this:

    function add_miles_to_filter_labels($input_object, 2116) {
      if(($input_object['name']!='_sfm_distance[]') {
        return $input_object;
      }
      foreach($input_object['options'] as $option) {
        $option->label .= " miles";
      }
      return $input_object;
    }
    add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
    Anonymous
    #214931

    Still getting a Parse Syntax error unfortunately.

    Trevor
    #214935

    Spotted another errod, sorry.

    function add_miles_to_filter_labels($input_object, 2116) {
      if($input_object['name']!='_sfm_distance[]') {
        return $input_object;
      }
      foreach($input_object['options'] as $option) {
        $option->label .= " miles";
      }
      return $input_object;
    }
    add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
    Anonymous
    #214939

    Sorry, still getting the Parse error

    Trevor
    #214942
    This reply has been marked as private.
    Anonymous
    #215073

    Any luck with this?.

    Trevor
    #215075
    This reply has been marked as private.
    Trevor
    #215141

    I had a thought. Try this:

    function add_miles_to_filter_labels($input_object, $sfid) {
      if(($input_object['name']!='_sfm_distance[]'||($sfid != 2216)) {
        return $input_object;
      }
      foreach($input_object['options'] as $option) {
        $option->label .= " miles";
      }
      return $input_object;
    }
    add_filter('sf_input_object_pre', 'add_miles_to_filter_labels', 10, 2);
    Anonymous
    #215147

    Thanks, that looked promising but still get a parse error I’m afraid.

    Trevor
    #215152
    This reply has been marked as private.
Viewing 10 posts - 11 through 20 (of 24 total)