Skip to content

Instantly share code, notes, and snippets.

@MrVibe
Created November 3, 2018 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrVibe/091a9e02c17bf557b80a644ac6400ebd to your computer and use it in GitHub Desktop.
Save MrVibe/091a9e02c17bf557b80a644ac6400ebd to your computer and use it in GitHub Desktop.
WPLMS Show Course online/offline status in Course details
add_filter('wplms_course_details_array',function($details){
$details['unit_duration'] = array(
'label'=>_x('Course Offline/Online Status','label in details array','vibe-customtypes'),
'callback'=> 'custom_get_course_offline_online_status',
);
return $details;
});
function custom_get_course_offline_online_status(){
$offline = get_post_meta(get_the_ID(),'vibe_course_offline',true);
return '<li>'._x("Type","Course Detail Sidebar Average Rating","vibe-customtypes").'<i class="course_detail_span">'.(($offline === 'S')?'Offline':'Online').'</i></li>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment