/** * Ouput the single lesson meta * * The function should only be called on the single lesson * */ function sensei_the_single_lesson_meta() { // if the lesson meta is included within theme load that instead of the function content $template = Sensei_Templates::locate_template('single-lesson/lesson-meta.php'); if (!empty($template)) { Sensei_Templates::get_template('single-lesson/lesson-meta.php'); return; } // Get the meta info $lesson_course_id = absint(get_post_meta(get_the_ID(), '_lesson_course', true)); $is_preview = Sensei_Utils::is_preview_lesson(get_the_ID()); // Complete Lesson Logic do_action('sensei_complete_lesson'); // Check that the course has been started if (Sensei()->access_settings() || Sensei_Utils::user_started_course($lesson_course_id, get_current_user_id()) || $is_preview) { ?> <section class="lesson-meta"> <?php if (apply_filters('sensei_video_position', 'top', get_the_ID()) == 'bottom') { do_action('sensei_lesson_video', get_the_ID()); } ?> <?php do_action('sensei_frontend_messages'); ?> <?php if (!$is_preview || Sensei_Utils::user_started_course($lesson_course_id, get_current_user_id())) { sensei_do_deprecated_action('sensei_lesson_quiz_meta', '1.9.0', 'sensei_single_lesson_content_inside_before', array(get_the_ID(), get_current_user_id())); } ?> </section> <?php do_action('sensei_lesson_back_link', $lesson_course_id); ?> <?php } do_action('sensei_lesson_meta_extra', get_the_ID()); }
/** * Deprecate the sensei_lesson_archive_header hook but keep it * active for backwards compatibility. * * @deprecated since 1.9.0 */ public static function deprecate_sensei_lesson_archive_header_hook() { sensei_do_deprecated_action('sensei_lesson_archive_header', '1.9.0', 'sensei_loop_lesson_inside_before'); }
/** * Fire the course image hook * * @since 1.8.0 */ public static function fire_course_image_hook() { global $course; sensei_do_deprecated_action('sensei_course_image', '1.9.0', 'sensei_single_course_content_inside_before', array(get_the_ID())); }
/** * This function calls the deprecated hook 'sensei_single_course_modules_content' to fire * * @since 1.9.0 * @deprecated since 1.9.0 * */ public static function deprecate_sensei_single_course_modules_content() { sensei_do_deprecated_action('sensei_single_course_modules_content', '1.9.0', 'sensei_single_course_modules_before or sensei_single_course_modules_after'); }
public function sensei_course_category_main_content() { global $post; if (have_posts()) { ?> <section id="main-course" class="course-container"> <?php do_action('sensei_course_archive_header'); ?> <?php while (have_posts()) { the_post(); ?> <article class="<?php echo join(' ', get_post_class(array('course', 'post'), get_the_ID())); ?> "> <?php sensei_do_deprecated_action('sensei_course_image', '1.9.0', 'sensei_single_course_content_inside_before', get_the_ID()); ?> <?php sensei_do_deprecated_action('sensei_course_archive_course_title', '1.9.0', 'sensei_course_content_inside_before', $post); ?> <?php do_action('sensei_course_archive_meta'); ?> </article> <?php } // End While Loop ?> </section> <?php } else { ?> <p> <?php _e('No courses found that match your selection.', 'woothemes-sensei'); ?> </p> <?php } // End If Statement }
/** * Output the headers on the course archive page * * Hooked into the sensei_archive_title * * @since 1.9.0 * @param string $query_type * @param string $before_html * @param string $after_html * @return void */ public static function archive_header($query_type = '', $before_html = '', $after_html = '') { if (!is_post_type_archive('course')) { return; } // deprecated since 1.9.0 sensei_do_deprecated_action('sensei_archive_title', '1.9.0', 'sensei_archive_before_course_loop'); $html = ''; if (empty($before_html)) { $before_html = '<header class="archive-header"><h1>'; } if (empty($after_html)) { $after_html = '</h1></header>'; } if (is_tax('course-category')) { global $wp_query; $taxonomy_obj = $wp_query->get_queried_object(); $taxonomy_short_name = $taxonomy_obj->taxonomy; $taxonomy_raw_obj = get_taxonomy($taxonomy_short_name); $title = sprintf(__('%1$s Archives: %2$s', 'woothemes-sensei'), $taxonomy_raw_obj->labels->name, $taxonomy_obj->name); echo apply_filters('course_category_archive_title', $before_html . $title . $after_html); return; } // End If Statement switch ($query_type) { case 'newcourses': $html .= $before_html . __('New Courses', 'woothemes-sensei') . $after_html; break; case 'featuredcourses': $html .= $before_html . __('Featured Courses', 'woothemes-sensei') . $after_html; break; case 'freecourses': $html .= $before_html . __('Free Courses', 'woothemes-sensei') . $after_html; break; case 'paidcourses': $html .= $before_html . __('Paid Courses', 'woothemes-sensei') . $after_html; break; default: $html .= $before_html . __('Courses', 'woothemes-sensei') . $after_html; break; } // End Switch Statement echo apply_filters('course_archive_title', $html); }
/** * Run the sensei_quiz_question_type action for those still hooing into it, but depreate * it to provide user with a better alternative. * * @deprecated since 1.9.0 */ public static function deprecate_sensei_quiz_question_type_action() { // Question Type global $sensei_question_loop; $question_type = Sensei()->question->get_question_type($sensei_question_loop['current_question']->ID); sensei_do_deprecated_action('sensei_quiz_question_type', '1.9.0', 'sensei_quiz_question_inside_after', $question_type); }
/** * This functions runs the old sensei_quiz_action_buttons action * for backwards compatiblity sake. * * @since 1.9.0 * @deprecated */ public static function deprecate_sensei_quiz_action_buttons_hook() { sensei_do_deprecated_action('sensei_quiz_action_buttons', '1.9.0', 'sensei_single_quiz_questions_after'); }
/** * Deprecate the deprecate_sensei_learner_profile_content hook * * @since 1.9.0 */ public static function deprecate_sensei_learner_profile_content_hook() { sensei_do_deprecated_action('sensei_learner_profile_content', '1.9.0', 'sensei_learner_profile_content_before'); }