Placeholder text is missing

Home Forums BP Profile Search Forum Placeholder text is missing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11163 Reply
    Gautham
    Guest

    For the profile search form I used on Elementor is not showing the default value or any placeholder text in the drop downs.

    There is an additional ‘option’ set without any value and that is being selected as default. (so it shows as blank)

    How do I fix this?

    Plugins I have:
    BuddyPress
    BuddyBuilder
    BuddyBuilder Pro
    Elementor
    Elementor Pro

    Theme is KLEO
    However, even in the default theme the issue is still there.

    Please help me out

    #11164 Reply
    andrea
    Keymaster

    Hi Gautham,

    To add a placeholder to a drop-down field, place this code in your bp-custom.php or functions.php file:

    add_action ('bps_field_before_search_form', 'set_placeholder');
    function set_placeholder ($f)
    {
    	if ($f->code == 'field_35' && $f->display == 'selectbox')
    	{
    		$f->options[''] = 'select a value...';
    	}
    }

    Replace 35 with the actual field ID of your profile field.

    If you wish to force a default value instead, please have a look at:

    https://dontdream.it/bp-profile-search-5-3/

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Placeholder text is missing
Your information: