Display dropdown profile field data in Profile Header
-
Hello,
What is the proper way to display dropdown profile field data in other places like the profile header?
Here’s what I’ve written so far (works with text fields and checkbox fields):
add_filter( 'bp_do_register_theme_directory', '__return_true' ); function my_directory() { if ( bp_is_active( 'xprofile' ) ) if ( $memberRoles2 = xprofile_get_field_data( 'Starting', bp_get_member_user_id() ) ) : echo '<h5 class="adneed">'; echo '<span class="adneedcontent">'; echo 'starting'; echo '</span>'; foreach ( $memberRoles2 as $memberRoles2 ) { echo '<div class="roles">'; echo $memberRoles2; echo ', </div>'; } echo '</h5>'; endif; add_filter ( 'bp_directory_members_item', 'my_directory' );
This is the error I get:
Warning: Invalid argument supplied for foreach() in /home/tvfilmpa/staging/2/wordpress/wp-content/plugins/bp-custom.php on line 139
Any help regarding this issue is greatly, greatly appreciated!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Display dropdown profile field data in Profile Header’ is closed to new replies.