How to retrieve usermeta data on members page ?
-
I have added a signup field like this:
/* Add sign-up field to BuddyPress sign-up array */
`function newbp_custom_user_signup_field( $usermeta ) {
$usermeta = $_POST;return $usermeta;
}
add_filter( ‘bp_signup_usermeta’, ‘newbp_custom_user_signup_field’ );`/* Add field_name from sign-up to usermeta on activation */
`function newbp_user_activate_field( $signup ) {update_usermeta( $signup, ‘newfield’, $signup );
return $signup;
}
add_filter( ‘bp_core_activate_account’, ‘newbp_user_activate_field’ );`Have tried the following function
`function getnewfield() {
$data = get_user_meta($user_id, $newfield);
if ( $data )
echo “New Field Label: $data “;
}
add_action( ‘bp_directory_members_item’, ‘getnewfield’ );`But it has not retrieved the data. ?
> the data is in the wp_usermeta database for each user_idAny input appreciated.
(why usermeta ? Am trying out multi-networks and profile data appears to be network specific whereas usermeta data attaches to user across entire installation. ie. a user can have different profile info in different networks but his/her usermeta data is universal. I would like some user info to be universal! )
wp 3.4.1,bp 1.6.1, multi-site, bp-multi-networks, networks+
You must be logged in to reply to this topic.