Class Sensei_Course
Sensei Course Class
All functionality pertaining to the Courses Post Type in Sensei.
public
|
|
public
|
#
update_status_after_quiz_submission( type $user_id, type $quiz_id )
Fires when a quiz has been graded to check if the Course status needs changing |
public
|
#
update_status_after_lesson_change( integer $user_id, integer $lesson_id )
Fires when a lesson has changed to check if the Course status needs changing |
public
|
|
public
|
#
course_woocommerce_product_meta_box_content( )
course_woocommerce_product_meta_box_content function. |
public
|
|
public
|
|
public
|
|
public
integer
|
|
public
|
|
public
|
|
public
array
|
|
public
|
|
public
array
|
#
course_query( integer $amount = 0, string $type = 'default', array $includes = array(), $excludes = array() )
course_query function. |
public
array
|
#
get_archive_query_args( string $type = '', integer $amount = 0 , array $includes = array(), $excludes = array() )
get_archive_query_args function. |
public
string
|
#
course_image( integer $course_id = 0, string $width = '100', string $height = '100', boolean $return = false )
course_image function. |
public
integer
|
|
public
array{
|
#
course_lessons( integer $course_id = 0, string $post_status = 'publish', string $fields = 'all' )
course_lessons function. |
protected
integer
|
#
_short_course_lessons_callback( array $lesson_1, array $lesson_2 )
Used for the uasort in $this->course_lessons() |
public
array
|
#
course_quizzes( integer $course_id = 0, boolean $boolean_check = false )
Fetch all quiz ids in a course |
public
array
|
#
course_lessons_completed( integer $course_id = 0, string $post_status = 'publish' )
course_lessons_completed function. Appears to be completely unused and a duplicate of course_lessons()! |
public
integer
|
#
course_author_lesson_count( integer $author_id = 0, integer $course_id = 0 )
course_author_lesson_count function. |
public
integer
|
|
public
integer
|
|
public
array
|
|
public static
array
|
|
public
|
|
public
string
|
#
load_user_courses_content( object $user = false , boolean $manage,… )
load_user_courses_content generates HTML for user's active & completed courses |
public static
array
|
|
public
string
|
|
public
string
|
#
get_progress_statement( integer $course_id, integer $user_id )
Generate a statement that tells users how far they are in the course. |
public
|
|
public
|
|
public
array
|
#
get_completed_lesson_ids( integer $course_id, integer $user_id = 0 )
Checks how many lessons are completed |
public
integer
|
#
get_completion_percentage( integer $course_id, integer $user_id = 0 )
Calculate the perceantage completed in the course |
public
boolean
|
#
block_notification_emails( $should_send )
Block email notifications for the specific courses that the user disabled the notifications. |
public
|
|
public
|
#
save_course_notification_meta_box( $course_id )
Store the setting for the course notification setting. |
public
|
#
content_before_backwards_compatibility_hooks( WP_Post $post_id )
Backwards compatibility hooks added to ensure that plugins and other parts of sensei still works. |
public
|
#
loop_before_backwards_compatibility_hooks( )
Backwards compatibility hooks that should be hooked into sensei_loop_course_before |
public
|
#
the_course_free_lesson_preview( integer $course_id )
Output a link to view course. The button text is different depending on the amount of preview lesson available. |
public
|
|
public static
array
|
#
add_course_user_status_class( $classes, $class, $course_id )
Filter the classes attached to a post types for courses and add a status class for when the user is logged in. |
public static
|
|
public static
WP_Query
|
#
course_query_filter( WP_Query $query )
This function alter the main query on the course archive page. This also gives Sensei specific filters that allows variables to be altered specifically on the course archive. |
public static
array
|
|
public static
mixed|
|
|
public static
|
|
public static
|
|
public static
WP_Query
|
#
course_archive_featured_filter( WP_Query $query )
if the featured link is clicked on the course archive page filter the courses returned to only show those featured |
public static
WP_Query
|
|
public static
string
|
#
get_courses_page_url( )
Get the link to the courses page. This will be the course post type archive page link or the page the user set in their settings |
public static
|
#
archive_header( string $query_type = '' , string $before_html = '', string $after_html = '' )
Output the headers on the course archive page |
public static
string
|
#
single_course_content( string $content )
Filter the single course content taking into account if the user has access. |
public static
|
|
public static
|
#
load_single_course_lessons_query( )
This function loads the global wp_query object with with lessons of the current course. It is designed to be used on the single-course template and expects the global post to be a singular course. |
public static
|
|
public static
string
|
#
full_content_excerpt_override( $excerpt )
Optionally return the full content on the single course pages depending on the users course_single_content_display setting |
public static
|
#
the_course_enrolment_actions( )
Output the course actions like start taking course, register, add to cart etc. |
public static
|
|
public static
|
|
public static
|
|
public static
WP_Query
|
#
alter_course_category_order( WP_Query $query )
Alter the course query to respect the order set for courses and apply this on the course-category pages. |
public static
array
|
#
get_default_query_args( )
The very basic course query arguments so we don't have to repeat this througout the code base. |
public static
boolean
|
#
is_prerequisite_complete( $course_id )
Check if the prerequisite course is completed Courses with no pre-requisite should always return true |
public
|
#
allow_course_archive_on_front_page( WP_Query $query )
Allowing user to set course archive page as front page |
public
|
$token
|
|
public
array
|
$meta_fields
$meta_fields |
|
public
string|boolean
|
$my_courses_page
$my_courses_page reference to the sites my courses page, false if none was set |