• Hi,

    I’m using buddyboss with profile fields and your plugin. I want to modify the integer-range display. Make the age range two drop-down select boxes instead of two input boxes. I used the code below. Also tried field_4_age_range instead of field_4, but doesn’t work either. Please help!

    add_action ('bps_field_before_search_form', 'change_display');
    function change_display ($f)
    {
        if ($f->code == 'field_4' && $f->display == 'integer-range')
        {
            $f->display = 'range-select';
            $range = range (18, 60);
            $f->options = array ('' => '') + array_combine ($range, $range);
        }
    }
Viewing 1 replies (of 1 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi PvK2020,

    Make sure you replace field_4 with field_xx, where xx is the actual ID of your profile field.

    If you are not using the standard BP Profile Search plugin, but the basic version contained in the BuddyBoss Platform, replace the line:

    add_action ('bps_field_before_search_form', 'change_display');

    with:

    add_action ('bp_ps_field_before_search_form', 'change_display');

    Please let me know if this works for you!

Viewing 1 replies (of 1 total)
  • The topic ‘Age range dropdown’ is closed to new replies.