Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get all xprofile select field options

  • @mlcapulong

    Participant

    Hi,

    I’ve created an xprofile select field and a custom registration page. Is there a way to get all of that field’s options and use it in my custom registration page? I don’t want to do the default BP regsitration.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • @henrywright

    Moderator

    Hi @mlcapulong

    If you know the field ID, you can do this:

    $field = new BP_XProfile_Field( $field_id );
    $children = $field->get_children();
    if ( $children ) {
        foreach ( $children as $child ) {
            // Do something here.
            // var_dump( $child );
        }
    }

    @mlcapulong

    Participant

    Thank you, @henrywright! Can you also tell me how to get the fied ID?

    @mlcapulong

    Participant

    Nevermind, found a way using this function

    xprofile_get_field_id_from_name( $field_name )

    Thanks!

    @henrywright

    Moderator

    Yes, xprofile_get_field_id_from_name() will get you the field ID 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar