Could this work with a empty checking or null value on the $data? That would be my first suggestion.
I think it could be achieved by adding an empty checking which i have no clue. i think something loke “if empty return” could do.
`
<?php
global $bp;
$data = bp_get_profile_field_data(‘field=Country’);
$user_status = is_user_logged_in() ;
$add_data_link = $bp->loggedin_user->domain . ‘/profile/edit/group/1’;
?>
`
Make sure that you change the link in $add_data_link at the end … you can check out the slug and see in what group is the Country field located …
@Alan, i will try it and if i run into any problem , i will let you know.
regards
@Alan, or can someone please help me look at this code to know if something is wrong, have tried it and everything seems ok if the member did not add the “country field” as it shows the link and take you to the edit page, but immediately you input the field “Country” e.g “UK” and save, it breaks both Admin bar and the Sidebar.
@uloga,or can someone please help me look at this code to know if something is wrong, have tried it and everything seems ok if the member did not add the “country field” as it shows the link and take you to the edit page, but immediately you input the field “Country” e.g “UK” and save, it breaks both Admin bar and the Sidebar. please someone help.
Try this:
`<?php
bp_profile_field_data( ‘field=Country’ );
?>`
@alfredojp, thanks for your input, i know i can use that code to get some profile field but if you read my post you will know that what am trying to achieve is more than just profile field.
thanks anyways