Hi LavishDhand,
Which type is your ‘height’ field? If it’s a Number, you should find the ‘range’ option in the Search Mode drop-down, where the ‘Range’ checkbox used to be.
Hi @dontdream
My height field is ‘Drop Down Select Box’. Values are predefined.
Example
165.10 cm (5’5″)
167.64 cm (5’6″)
170.18 cm (5’7″)
172.72 cm (5’8″)
How can I change this to number field? Won’t I lose the old data / settings if I change the field type to number now?
Thank you for the help
Hi @lavishdhand,
To bring back the range search for your ‘Drop Down Select Box’ field, add this code to your file bp-custom.php:
add_filter ('bps_xprofile_format', 'change_format', 10, 2);
function change_format ($default, $field_id)
{
if ($field_id == 1435) return 'decimal';
return $default;
}
Replace 1435 with the actual ID of your field.
You also need to revert to BP Profile Search 4.7.8, the download is at the end of this page:
https://wordpress.org/plugins/bp-profile-search/advanced/
This last step is temporary, when I release BP Profile Search 4.8 you can update the plugin as usual.
Please let me know if these changes work for you!
That worked! Thank you. I however have one more field for ‘weight’, this field type is ‘Text Box’. What do I add to the code to fix this one too?
Thanks for all the help
Great, glad it worked!
To change the format of two fields:
add_filter ('bps_xprofile_format', 'change_format', 10, 2);
function change_format ($default, $field_id)
{
if ($field_id == 1435) return 'decimal';
if ($field_id == 2860) return 'decimal';
return $default;
}
Awesome! This has fixed the problem. Thank you for the help 🙂
You are welcome, and thank you for your review!