Skip to:
Content
Pages
Categories
Search
Top
Bottom

friends_check_friendship returning 1 or blank instead of true or false


  • mattnetusa
    Participant

    @mattnetusa

    I have this short code I am using to pass along the user id of the user who put entries in to my form.

    
    add_shortcode('mx-check-if-friends','mx_friends_check_friendship');
    function mx_friends_check_friendship( $atts ){
    	extract(shortcode_atts(array(
    		'possible_friend_id' => '',
    	), $atts ) );
    	global $current_user;
    	get_currentuserinfo();
    	$user_ID = $current_user->ID;
    	return friends_check_friendship( $user_ID, $possible_friend_id );
    }

    To call it, I use: [mx-check-if-friends possible_friend_id=[88 show=”ID”]] where 88 is the field of the user who entered the data into the form. For some reason, this is returning the number 1 if it’s a friend or a blank if not a friend. Which is all good, but why is it not returning a True or a False?

  • The topic ‘friends_check_friendship returning 1 or blank instead of true or false’ is closed to new replies.
Skip to toolbar