How can I add a default min and max age range?

Home Forums BP Profile Search Forum How can I add a default min and max age range?

This topic contains 1 reply, has 2 voices, and was last updated by  andrea 1 week, 3 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10415 Reply

    Daniel Forteza

    Hi Andrea,

    How can I add a default min and max age range? Any coding I should add?

    See snapshot: https://prnt.sc/qz8

    #10416 Reply

    andrea
    Keymaster

    Hi Daniel,

    Here is a sample code that you can add to your bp-custom.php:

    add_action ('bps_field_before_search_form', 'set_defaults');
    function set_defaults ($f)
    {
    	if ($f->code == 'field_4')
    	{
    		$f->value['min'] = 18;
    		$f->value['max'] = 99;
    	}
    }
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: How can I add a default min and max age range?
Your information: