@logan
I think its Bug: is_instructor function fails when you try to check instructor for course by passing course id (when gloabl post not set or i mean out of WP loop)
vibe-course-module.zip\vibe-course-module\includes\bp-course-template.php
Passing $id is useless in this function as it is doing nothing with that,
function is_instructor($id=NULL){
if(!is_user_logged_in())
return false;
global $post;
if(!isset($id)){
$id= $post->ID;
}
$uid = bp_loggedin_user_id();
$authors=array($post->post_author);
$authors = apply_filters('wplms_course_instructors',$authors,$post->ID);
if(in_array($uid,$authors) )
return true;
return false;
}
So I think It should be like this.
function is_instructor( $id = NULL ){
if(!is_user_logged_in())
return false;
if( $id ){
$post = get_post( $id );
}else{
global $post;
}
$uid = bp_loggedin_user_id();
$authors = array($post->post_author);
$authors = apply_filters('wplms_course_instructors', $authors, $post->ID);
if( in_array( $uid, $authors ) )
return true;
return false;
}
Well then I can use it like to check instructor anywhere..
is_instructor( $course_id);