Your issue is due to implementation.
But without knowing how you are implementing, it is impossible to offer suggestions.
If you create a gist of your code and post the link here, somebody may have a suggestion.
https://gist.github.com/anonymous/53a6c1369a1ad21c7259a5d2f41da845
this is the code to display the number with **** to replace the last 4 digits, i am using JS to control the toggle of the number so when clicked will reveal the digits. It works like this but when i change the if statement to;
if (current_user_can('client') && !bp_is_my_profile())
it throws the entire profile page layout out of wack.
Are you sure bp_is_my_profile() is working in that context ?
Place a test above your if, something like:
if ( bp_is_my_profile() ) echo 'YES';
else echo 'NO';
Okay so that seems to work alright, echoing YES on own profile and NO on other profile (and the opposite if i put !bp_is_my_profile(), it also doesn’t seem to mess up the layout just doing it like that so (somehow) when used in that small bit of code and only as !bp_is_my_profile (a true check works but its not what i need) the layout messes up.
FIXED
Ended up nesting my original if code within a !bp_is_my_profile() if condition which worked.
Thanks for the light bulb moment @shanebp
Closed.