Hi really need help here is my function.
function isdAuthorTrue( $post_id ) {
$coauthors = get_post_meta( $post_id, "coAuthors" );
print_r($coauthors);
// print_r output Array ( [0] => 78 )
$key = array_search( 78, $coauthors );
$key = 0;
if($key !== false) {
return true;
} else {
return false;
}
}
then i am trying to do and if statement around it that isnt working.
$test = isdAuthorTrue( 102 );
echo $test;
if($test){
echo "yes";
}else{
echo "no";
}
i keep getting no what am i doing wrong???