BP Profile Search › Field object properties
-
AuthorPost
-
Henry Wright
GuestHi Andrea,
I have a question about the field object data given by
var_dump( $f ).stdClass Object ( [group] => Personal [id] => 1952 [code] => field_1952 [name] => Eyes [description] => [type] => checkbox [options] => Array ( [A] => Blue [B] => Brown [C] => Green ) [filters] => Array ( [0] => ) [display] => checkbox [search] => bps_xprofile_search [label] => Eyes [value] => [max] => [min] => [values] => Array ( ) )I can see the field ID is available via
$f->id, but when it comes to fields such as checkboxes, option IDs don’t seem to be available.Here’s an example of what I need to do in my custom search form template. Please note id=”2115″, id=”2116″ and id=”2117″. These are option IDs and aren’t currently unavailable in
$f.<fieldset class="checkbox"> <legend>Eyes</legend> <div id="field_1952"> <input type="checkbox" name="field_1952[]" id="2115" value="Blue"> <input type="checkbox" name="field_1952[]" id="2116" value="Brown"> <input type="checkbox" name="field_1952[]" id="2117" value="Green"> </div> </fieldset>Henry Wright
GuestI decided to get the option IDs inside my custom form template.
Regards
Henryandrea
Plugin AuthorHi Henry,
Sorry for the late reply. Yours is the right choice for the time being, but I’ll try to add that info to the field object properties.
Henry Wright
GuestThanks Andrea
-
AuthorPost