If Profile Field is Not Empty, Set Profile Field Data?
-
I am trying to create a function in bp-custom.php where if a user inputs data into a profile field, another field is automatically set to “Pending” (from empty).
I know I have to use xprofile_get_field_data to determine the field I wish to determine is empty or not empty.
Then use an if statement along with xprofile_set_field_data to input the word or option to insert if this field is not empty (!empty).function profile_stream ( $user_id ) { $streamid = xprofile_get_field_data( 10, $user_id ); if (!empty($streamid)) { xprofile_set_field_data( 11, $user_id, "Pending"); } }
MySQL table numbers for wp_bp_xprofile_fields are ’10’ and ’11’ as reflected in the code.
Any tips on how to get this working?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.