Omega is friend

<?php
function omega_is_friend(){
global $bp;
$friendship = false;
$user_object = wp_get_current_user();
$current_username = $user_object->user_login;
$members_id = $bp->displayed_user->id;
if(bp_has_members('type=newest&max='. $max_friends .'&user_id=' . $members_id) & is_user_logged_in()) :
while (bp_members()) : bp_the_member();
$the_friend_name = bp_get_member_user_login();
if($current_username == $the_friend_name){
$friendship = true;
return $friendship;
}
else { return $friendship; }
endwhile;
else:
return $friendship;
endif;
}
?>

0 Comments

You must be logged in to post a comment.