Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to get list of xprofile filds

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    Best? That depends on the context.
    Here’s one way:

    $profile_groups = BP_XProfile_Group::get( array( 'fetch_fields' => true	) );
    
    if ( !empty( $profile_groups ) ) {
    	 foreach ( $profile_groups as $profile_group ) {
    		if ( !empty( $profile_group->fields ) ) {				
    			foreach ( $profile_group->fields as $field ) {
    				echo $field->id . ' - ' . $field->name . '<br/>';
    			}
    		}
    	}
    }
Viewing 1 replies (of 1 total)
  • The topic ‘how to get list of xprofile filds’ is closed to new replies.
Skip to toolbar