Hi
I use (and love) the plugin BuddyPress Profile Completion. Is it possible to check if a user profile is completed using a function in a custom plugin?
I could create a manual call to the database and check for the meta key “_has_complete_profile” for the specific user id in the usermeta table, but I if there’s a built-in solution I’ll not do it 🙂
Among other things I need to check if a user has set his birth date in his profile, and if he hasn’t then write a message etc.
Thanks
TorbenHi Torben,
Thank you for the question.You may use this
if ( function_exists( 'bpprocn_has_incomplete_profile' ) && ! bpprocn_has_incomplete_profile( $user_id ) ) { }
Please replace the $user_id with the desired id.
We do not have any specific API for field data since BuddyPress already provides that.
You may use either ‘xprofile_get_field_data’ or ‘BP_XProfile_ProfileData::get_value_byid’ to check if the field has data(2nd should be preferred if checking for data availability, 1st for display).
Regards
BrajeshAwesome, thanks! I managed to write a custom function using xprofile_get_field_data to check for both birthdate and another setting. It works 🙂
Thank you for the reply.
I am glad you were able to solve it 🙂
Regards
Brajesh
The topic ‘ [Resolved] How do I check if user profile is complete?’ is closed to new replies.