Forums Forums Search & Filter Pro Default value select

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #260434

    i`m using unset to delete first two option values but i need it to be default, how to do this?? thanks

    function filter_function_name($input_object, $sfid)
    {
    if($input_object[‘name’]==’_sft_tax_news’)
    {
    /*foreach($input_object[‘options’] as $option)
    {
    if($option->value==”maironio-lietuviu-literaturos-muziejus”)
    {
    $option->label = “AAA”;
    $option->attributes[‘class’] = “sf-option-active”;
    $option->attributes[‘selected’] = “selected”;
    }
    }*/
    unset($input_object[‘options’][0]);
    unset($input_object[‘options’][1]);
    return $input_object;
    //udpate this field before rendering
    }
    else{
    echo “NOOO!”;
    return $input_object;
    }
    }
    add_filter(‘sf_input_object_pre’, ‘filter_function_name’, 10, 2);

    filter_function_name(array(‘name’ => ‘_sft_tax_news’),17402);

    Trevor
    #260539

    This has been asked before, but I a sorry, there is no way to preselect the default value/term. This is something we plan to add for V3, due in a few months.

    Anonymous
    #276401

    Has this now been added as a feature?

    Trevor
    #276403

    Not yet, I am sorry.

    Anonymous
    #276499

    Hello Trevor,
    is it still not possible to set default values?

Viewing 5 posts - 1 through 5 (of 5 total)