/** * When the_post is called, put course data into a global. * * @param mixed $post * * @return LP_Course */ function lp_setup_course_data($post) { if (isset($GLOBALS['course'])) { unset($GLOBALS['course']); } if (is_int($post)) { $post = get_post($post); } if (empty($post->post_type) || !in_array($post->post_type, array('lpr_course'))) { return; } $GLOBALS['course'] = lp_get_course($post); return $GLOBALS['course']; }
function learn_press_get_course($the_course) { return lp_get_course($the_course); }