Field object properties

BP Profile Search › Field object properties

  • Author
    Post
  • #8589 Reply
    Henry Wright
    Guest

    Hi 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>

    Ref: http://dontdream.it/bp-profile-search/form-templates/

    #8590 Reply
    Henry Wright
    Guest

    I decided to get the option IDs inside my custom form template.

    Regards
    Henry

    #8598 Reply
    andrea
    Plugin Author

    Hi 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.

    #8600 Reply
    Henry Wright
    Guest

    Thanks Andrea

Reply to: Field object properties
My Information