This section describes the functioning of the WPLMS system. WPLMS is a complex system which works on top of several functionalities which are provided by the plugins included in the theme.
- BuddyPress : For Members, Groups, Messaging, Directories .
- BBPress : For Forums used in the theme.
- WooCommerce : For selling products which in turn activate course.
- Vibe Course Module : Link for Courses and BuddyPress .
- Vibe Custom types : The backend of LMS in WP Admin area.
- Vibe Shortcodes : All the shortcodes used in the theme.
- WPLMS Assignments : For assignments functionality .
- WPLMS Front End : For front end course creation and the front end editor.
- WPLMS Dashboard : For Dashboards for Instructors and Students .
- WPLMS Events : For Course Events.
Each of these plugins covers a specific area, for example, if you want to retain all the data you've created in the theme, you only need to make sure you;ve installed the Vibe Custom types plugin
System
This section would describe how the WPLMS System works.
- User Registration : This section is managed completely by BuddyPress and WordPress. Any page which is connected to the WP Admin - settings - buddypress - pages - registration becomes the registration page. BuddyPress overwrites this page and the content in the page is not loaded. WPLMS only adds styling to the page including the section accordion. This page is not avaiable to logged in users (because they're already registered) and has two sections. The first one is required and asks for User name (login), password and email, the second one section is built using the fields set in the WP Admin -> Users -> User fields section. Only
Note : This page is built using the template file : WPLMS/registration/register.php. To overwrite this page, copy the registeration folder from parent WPLMS theme into the child theme. Locate the register.php file and make changes.
- Activation : This section is managed completely by BuddyPress. Any page which is connected to the WP Admin - settings - buddypress - pages - Activate becomes the registration page. BuddyPress overwrites this page and the content in the page is not loaded This page is not avaiable to logged in users (because they're already registered) . Upon successful registration the user gets an email with an activation link, the link is of the format : http://yoursite.com/activation-page-slug/XXXYYY in this link the XXXYYY is the activation code.
When a user registers via BuddyPress it gets stored in the WP Signups table. The signups table also record the activation code.
When a user activates his account by clicking on the activation link or entering the activation code in the activation page, it creates the user from the WP Signups table.
Note : This page is built using the template file : WPLMS/registration/activate.php. To overwrite this page, copy the registeration folder from parent WPLMS theme into the child theme. Locate the activate.php file and make changes.
- Directory pages (All Members, All Activity, All Courses, All Groups) : All the directory pages are pages connected at the WP Admin - settings - BuddyPress - Pages section. Any page connected here is built using BuddyPress template files and none of the WordPress content will be shown.
For example : The course directory page is built using the wplms/course/index.php file. To overwrite this or build a new layout, you need to add the folder "course" in your child theme and add an index.php file which would overwrite the one in the parent WPLMS theme.
- Member Profiles : Member profiles are BuddyPress section. The default BuddyPress templates are overridden by WPLMS from the members section. The template files are located in the WPLMS/members section. Note that the members section has a course folder in it which has the template files for the course.
- My Courses : This section is located in User profile. Tempalte file is located at wplms/course/my-courses.php. Sub-sections include results and stats and instructing courses (for Instructors). The results and stats template files are located in the wplms/members/course/results.php and stat.php
- Dashboards : User dashboard is built by the WPLMS Dashboards plugin. The template file is located in the wplms-dashboard/includes/templates/dashboard.php
- Activity : This is the activity section. This section records all the activity in the site. All activity is recorded in the wp_bp_activity table and the activity meta table. Template files for the activity is located in wplms/activity folder. For user profile activity template files are located in the wplms/members/activity folder.
- Courses : Courses are built in the LMS system and are integrated in the BuddyPress via the course module plugin. The main page is controlled via WordPress from the tempalte wplms/single-course.php whereas the sub-page templates (curriculum,members,admin) are located in the wplms/course/single folder.
- Course Curriculum : Displays the curriculum build in the course. The course curriculum is stored as a serialised array in the post meta value of the course : vibe_course_curriculum
- Course Members : Displays members enrolled in a course. Every member subscribed to the course has a User meta value
- Course Forum : Any forum connected to a course in the Course settings section becomes a course forum. The value of Forum ID is stored in a post meta vibe_forum. The Course Forum privacy can be enabled from the LMS -> Settings section.
- Course Groups : Any Group conneted to a course in course settings becomes a course group. The value if the group id is stored in the post meta field vibe_group. This field contains the group id. By default all groups created in WPLMS (via front end) are assumed as private. When a user subscribes to a course she gets access to the group as well.
- Edit Course : This section is added by the WPLMS Front end plugin. A page connected to the WPLMS - Course manager opens when user clicks on the edit course. This is course creation page, note the ?action=234 in the url. The 234 is the course id, if you remove the course id from the url and reload the create course page will open a blank course. The course is created when the user clicks on the create course button.
- Course Admin : Displays admin actions for the course. Template file is located in the WPLMS /Course/single/admin.php
Course Functioning
This section explains how courses function in WPLMS
- Course Purchase : A course by default has no connection with the purchase process. The process of assignment starts after the course is purchased. In case of memberships, when a course is assigned to a membership level and a user who is subscribed to the membership level opens the course the course assignment starts.
For example: If a course is connected to a woocommerce product, then when the purchase for the course is finished. The course assignment starts when the order has been marked as complete, which is on the hook "woocommerce_order_status_completed". At this point the expiry point for the user purchasing the course is set. The expiry point is calculated on the product subscription (if set) or on course duration. Which equals current timestamp + the course duration/subscription duration
- Course Subscription : When a user is subscribed to a course. Two User meta values for the user are set : courseID and course_status.courseID, courseID is numeric value of course. The value for usermeta field "courseID" is the expiry timestamp for the user. Whereas the course_stats.courseID has value of 1 which indicates course is ready to begin. A postmeta field is also set for the course with key as UserID and value as 0.
- Course Start : When the subscribed user starts a course the Number of students in course counter increases. The course_status>courseID usermeta value is set to 2 which indicates the user has started the course. The course postmeta with key as userID is set to 1.
- Course Statuses : Course status govern the display of the take this course button.
Course status : 1 : START COURSE
Course status : 2 : CONTINUE COURSE
Course status : 3 : FINISH COURSE : COURSE UNDER EVALUATION
Course status : 4 : COURSE EVALUATED
Custom Course statuses can be added using this tutorial
- Course Submission : When course is submitted by the user the course_status.courseID user meta is set to 3
- Course Evaluation : When course is submitted by the user the course_status.courseID user meta is set to 4
- Badges : All badges are connected to courses and badge information is stored in course meta vibe_course_badge,vibe_course_badge_percentage,vibe_course_badge_title. The badges are stored in user meta field "badges" as a serialised array of course ids. This value is fetched in the user profile section to generate the badges for the course.
- Certificates : All certificates are connected to courses and badge information is stored in course meta vibe_course_certificate,vibe_course_certificate_template,vibe_course_passing_percentage. The certificates are stored in user meta field "certificates" as a serialised array of course ids. This value is fetched in the user profile section to generate the certificates for the course.
- Course Finish : When course is submitted by the user the course_status.courseID user meta is set to 4 and the postmeta field in the course is updated to marks obtained by the user in the course. These marks are shown in user results section.
- Course Expiry : When a user is active in a course but the expiry time set for the user is less than the current timestamp. The course appears as expired for the user. The expiry time is stored in user meta field where the user key is the course id.
This section describes the filters and hooks used in the theme.
Hooks
- WPLMS Theme :
- wplms_validate_certificate : Runs for certificate validation. Accepts two arguments : User ID and Course ID
- wplms_certificate_before_full_content : Runs before any content on default certificate
- wplms_certificate_extra_buttons : Runs where buttons for print is executed
- wplms_certificate_before_name : Runs on default certificate template before name.
- wplms_certificate_after_name : Runs on default certificate template after name
- wplms_certificate_after_content : Runs after certificate content has been executed for default certificate template
- wplms_certificate_after_full_content : Runs after all certificate is executed.
- bp_before_course_loop : Runs before any Course loop begins
- bp_before_directory_course_list : Runs on Course directory, Course Category taoxnomy, Instructor courses, Levels taxonomy pages, before the course list.
- bp_directory_course_item : Runs before every course item is listed in the directory or course loop
- bp_after_directory_course_list : Runs after course directory has been listed
- bp_after_course_loop : Runs after course loop
- bp_after_directory_course : Runs after curse directory. Also runs on Instructor courses page
- bp_after_directory_course_page : Runs at the end of course directory page
- bp_before_course_header : Runs before single course page : course header (left column) is displayed
- bp_before_course_header_meta : Runs before meta information for current course in single course
- bp_course_header_actions : Displays header actions, like instructor message/email on single course page
- bp_course_header_meta : Displays course header meta information like star rating, reviews for course
- bp_after_course_header : Runs after course header is displayed
- wplms_course_curriculum_section : Runs before Course curriculum is displayed
- wplms_course_before_front_main : Runs before Course page content is displayed in single course.
- wplms_before_course_description : Runs before course description is displayed
- wplms_after_course_description : After course description
- wplms_course_stats_panel : Runs before calculate stats icon is displayed in stats section of course admin
- wplms_before_create_course_header : Runs before Front end course creation template : create_Content is displayed.
- wplms_before_create_course_page : Runs before Course creation page is displayed
- wplms_front_end_pricing_content : Runs in pricing section of Course creation
- wplms_after_create_course_page : Runs after create course page
- wplms_header_top_login : Runs in header.php after login/register is displayed
- wplms_customizer_custom_css : Runs in Customizer generate CSS function. Accepts the argument $themecustomizer which is an array containing all the settings in the theme customizer.
- bp_before_sidebar_login_form : Runs before login drop down is displayed
- login_form : Runs after login form is displayed.
- wplms_be_instructor_button : Runs on the member index page for become and isntructor link
- bp_before_course_stats : Runs before course stats are displayed in Course - admin - stats
- wplms_before_notes_discussion : Runs before notes and discussion template shows content.
- wplms_course_sidebar_hook : Runs in Course search page
- bp_before_course_home_content : Runs on single course page before course description
- bp_course_options_nav : Hook for course navigation in single course.
- bp_before_course_body : Runs before main content of any section is shown in single course.
- wplms_load_templates : Runs after the templates have been loaded
- badgeos_wplms_submit_course : Runs when course has been submitted, accepts Course ID as argument.
- wplms_question_after_content : Runs after question content is displayed for single question
- wplms_before_quiz : Runs before header of single quiz
- wplms_front_end_quiz_controls : Runs after quiz content. Used to display front end controls.
- wplms_before_every_unit : Runs before every unit content, accepts unit ID as argument
- wplms_after_every_unit : Runs after every unit content, accepts unit ID as argument
- wplms_before_single_assignment : Runs before single assignment header is loaded.
- wplms_assignment_before_content : Runs before assignment content is loaded
- wplms_assignment_after_content : Runs after assignment content is loaded
- wplms_after_assignment : Runs at the end of the assignment.
- wplms_before_start_course : Runs at the begining of start course page before header. Usually used for access check.
- wplms_start_course : Runs at the beginging of start course page after header.
- wplms_unit_header : Runs at display unit header, Unit ID and Course ID as arguments.
- wplms_course_unit_meta : Runs after unit header. Unit ID as argument. Displays unit meta information like tags and instructors.
- wplms_course_start_after_time : Runs after Course time is displayed.
- wplms_course_start_after_timeline : Runs after Course timeline is displayed
- Vibe Course Module :
- wplms_course_product_puchased : Runs after Course product is purchased, Arguments : Course ID, USer ID, Expirty Time, Course Status(0)
- badgeos_wplms_start_course : Runs when the current user subscribes the coruse. Arguments : Course ID
- badgeos_wplms_unit_complete : Runs when current user finishes a unit. Arguments : UnitID, Course Progress % and Course ID
- wplms_student_course_remove : Runs when a user is removed from the course. Arguments : Course ID, User ID
- wplms_student_course_reset : Runs when course is reset for a user. Arguments : Course ID, USER ID
- wplms_badge_earned : Runs when a user earns a badge. Arguments : Course ID, User Badges array,User ID, Badge Filter Flag (used for restricting badge assignment on special conditions).
- wplms_certificate_earned : Runs when a user earns a Certificate. Arguments : Course ID, User certificates array,User ID, Certificate Filter Flag (used for restricting badge assignment on special conditions).
- badgeos_wplms_evaluate_course : Runs when Course is evaluated. Arguments : Course ID, Marks, User ID
- badgeos_wplms_evaluate_quiz : Runs when Quiz is evaluated. Arguments : Quiz ID, Marks, User ID
- wplms_course_manual_evaluation : Runs when Course is manually evaluated. Arguments : Course ID, User ID
- wplms_course_stats_process : Runs when user clicks on Process course stats. Accepts arguments passed by reference : Title of Stat, Stats array,Stats counter,Course ID,USER ID,Field name(example)
- wplms_mod_stats_process : Runs when user clicks on Process stats for Quiz, unit,assiggment. Accepts arguments passed by reference : Title of Stat, Stats array,Stats counter,Module ID,USER ID,Field name,Post Type of module(example)
- badgeos_wplms_submit_quiz : Runs when user submits a quiz. Arguments : Quiz ID
- wplms_before_quiz_begining :Runs before uquiz is displayed. Arguments : Quiz ID
- badgeos_wplms_start_quiz : Runs when user starts a quiz. Arguments : Quiz ID
- wplms_renew_course : Runs when User clicks on course retake. Arguments : Course ID , USer ID
- courses_setup_nav : Sets up Course navigation in members profile page
- bp_course_screen_my_courses : Runs on My Courses in profile
- bp_course_screen_my_results : Runs on My Results in profile
- bp_course_screen_course_stats : Runs on My stats in profile
- bp_course_instructing_courses : Runs on Instructing courses in profile
- WPLMS Assignments :
- badgeos_wplms_submit_assignment : Runs when assignment is submitted. Arguments : Assignment ID
Filters
- WPLMS Theme :
- wplms_allinstructors : Filter on Query arguments for All Instructors template.
- wplms_sidebar : Filter on Sidebar which is to be shown in Courses, Pages, posts etc.
- wplms_instructor_courses_style : Filter on featured block style name (course2, course...) for instructing courses
- wplms_certificate_code_user_id : Certificate validation, Filter on certificate code to return User ID
- wplms_certificate_code_course_id : Certificate validation, Filter on certificate code to return Course ID
- wplms_certificate_code_template_id : Certificate validation, Filter on certificate code to return Template ID
- wplms_certificate_heading : Default certificate title
- wplms_certificate_sub_heading : Default certificate sub heading
- wplms_certificate_before_course_title : Default certificate text
- bp_course_admin_before_course_students_list : Filters array of Student IDs in a course in course - admin - members section.
- wplms_curriculum_course_link : Course - Curriculum : Filters flag value, if returns 1 then the items (units/quizzes) in Course curriculum appear with direct links.
- wplms_curriculum_course_lesson : Course - Curriculum : Filters individual Unit html in Course - Curriculum. Accepts 1 more argument as Unit ID
- wplms_curriculum_time_filter : Course - Curriculum : Filters the time display html for every unit. Accepts 1 more argument that is the time value saved in Unit duration meta field.
- wplms_course_instructors : Filters out instructors IDs for a course. Used in Coauthor plus integration. Accepts 1 more argument, the ID of the course.
- wplms_create_course_settings : Filters out course settings array and their stored/default value
- wplms_frontend_create_course_pricing : Filters for Course pricing setting with their stored/defaut value
- wplms_front_end_pricing : Flag which enables/disables the pricing section from the front end course creation page.
- wplms_frontend_cpt_query : Modifies WP arguments for loading list of units,quizzes. Used in Instructor privacy and Linkage.
- wplms_front_end_course_delete : Filters flag which enables course deletion via front end.
- wplms_logo_url : Filters and returns Logo image link
- wplms-mobile-menu : Filter on Mobile Menu arguments
- wplms-top-menu : Filter on Mobile top arguments
- wplms-main-menu : Filter on Mobile main arguments
- wplms_customizer_config : Filter on Customizer config, can be used to add custom control in theme customiser
- wplms_pmpro_course_check : Filter on user expiration timestamp for course if course is subscribed via PMPro membership
- vibe_breadcrumbs_show_title : Filters Flag which displays current page title in breadcrumb, return 0 to disable.
- wplms_unit_print_button : Filter Print button html on certificate and unit pages
- wplms_registeration_page : Filters registration page link html in the header
- wplms_instructing_courses_endpoint : Filters instructing courses end point, default set to 'instructing-courses', append this end point on a authors page to get the list of courses published by the author.
- wplms_course_stats_list : Filters download stats options
- wplms_course_status : Filters out course status across the setup
- wplms_notes_dicussion_args : Filters out WP Query arguments on notes and discussion
- vibe_font_query_args : Filters out Font query arguments while loading google fonts
- wplms_login_widget_action : Filters the "action" link of Vibe Login dropdown in header. Useful to bypass server restrictions imposed by some hosting companies. example
- wplms_in_course_quiz : Filters flag to enable In course quiz
- wplms_direct_access_not_allowed : Filters message "Direct access not allowed"
- wplms_event_access_flag : Filters access to event content
- loop_shop_columns : Filters number of products in one row in shop page
- vibe_option_custom_sections : Filters out sections in options panel. Can be used to add custom options or information in options panel. Example
- Vibe Course Module :
- wplms_calculated_commission_base : Filters calculated commission for instructor for per course sale
- wplms_unit_mark_complete : Filters Mark unit complete HTML
- wplms_in_course_quiz_args : Filters WP Query arguments for In course quiz
- bp_course_wplms_filters : Filters Arguments passed by Filters in course directory
- bp_user_can_create_course : Filters true/false based on current user capability
- wplms_course_nav_menu : Filters Course Menu . Example
- bp_directory_course_search_form : Filters search form HTML
- wplms_auto_subscribe : Filters auto-subscribe (user gets subscribed to course on opening the course)for course. Accepts 1 more argument : Course ID
- wplms_take_course_page : Filters Take course page url, accepts Course ID as another argument
- wplms_finished_course_link : Filters finished course link when course is finished
- wplms_course_product_id : Filters Product ID for course take this course button. Arguements : Product ID, Course ID
- wplms_private_course_button : Filters link on Private course button
- wplms_private_course_button_label : Filters labels on Private course button
- wplms_course_details_widget : Filters course details array. example
- wplms_generate_quiz_questions : Filters quiz id returns list of questions generated for the user.
- wplms_unit_classes : Filters classes added in the units loaded inside the course start page.
- wplms_incorrect_quiz_answer : Filters incorrect quiz answer marks.
- wplms_course_drectory_default_order : Filters default course directory order. Used by LMS - settings
- bp_course_single_item : Filters classes on single course item in coruse directory
- wplms_display_course_instructor_avatar : Filters intructor avatar html
- wplms_instructor_meta : Filters instructor meta value html whereever instructor html is generated.
- wplms_course_credits_array : Filters the array of multiple payment modes of a course.
- wplms_course_marks : Filters out course marks html, example
- wplms_course_finished : Filters Course finished message.
- wplms_unfinished_unit_quiz_message : Filters unfinished Quiz or Unit message. Accepts Unit ID/Quiz ID as argument
- wplms_course_filters_course_cat : Filters out list of categories to be displayed in Course filters widget
- wplms_course_filter_admin_args : Filters WP User query arguments for Administrator to be included in Instructors.
- :
- Vibe Custom Types :
- vibe_course_duration_parameter : Filters course duration parameter, default set to 86400 seconds = 1 days
- vibe_drip_duration_parameter : Filters course duration parameter, default set to 86400 seconds = 1 days
- vibe_unit_duration_parameter : Filters course duration parameter, default set to 60 seconds = 1 minute
- vibe_quiz_duration_parameter : Filters course duration parameter, default set to 60 seconds = 1 minute
- vibe_product_duration_parameter : Filters course duration parameter, default set to 86400 seconds = 1 days
- vibe_assignment_duration_parameter : Filters course duration parameter, default set to 86400 seconds = 1 days
- wplms_post_metabox : Filters metabox arguments for posts
- wplms_page_metabox : Filters metabox arguments for pages
- wplms_course_metabox : Filters metabox arguments for courses
- wplms_course_product_metabox : Filters metabox arguments for Course pricing options
- wplms_unit_metabox : Filters metabox arguments for units
- wplms_question_metabox : Filters metabox arguments for questions
- wplms_quiz_metabox : Filters metabox arguments for quizzes
- wplms_testimonial_metabox : Filters metabox arguments for testimonial
- wplms_product_metabox : Filters metabox arguments for product
- wplms_events_metabox :Filters metabox arguments for Events
- wplms_certificate_metabox : Filters metabox arguments for certificate
- wplms_assignment_metabox : Filters metabox arguments for assignment
- wplms_survey_metabox : Filters metabox arguments for survey
- vibe_thumb_featured_image : Filters metabox arguments for featured images
- vibe_thumb_rating : Filters metabox arguments for ratings in featured blocks
- vibe_thumb_reviews : Filters metabox arguments for reviews in featured blocks
- vibe_thumb_instructor_meta : Filters metabox arguments for instructor meta information
- vibe_featured_thumbnail_style : Filters HTML generated by featured block
- wplms_backend_cpt_query : Filters WP Query for backend posts, used in Instructor privacy and linkage.
- WPLMS Front End :
- wplms_front_end_group_vars : Filters arguments for Group creation via front end
- wplms_front_end_forum_vars : Filters arguments for Forum creation via front end
- wplms_front_end_unit_vars : Filters arguments for Unit creation via front end
- wplms_front_end_quiz_vars : Filters arguments for Quiz creation via front end
- wplms_frontend_new_product : Filters arguments for Product creation via front end
- wplms_front_end_question_vars : Filters arguments for questions creation via front end
- wplms_front_end_assignment_vars : Filters arguments for assignment creation via front end
- wplms_unit_types : Filters available unit types
Execution sequence
This doc explains the sequence of hooks and filters in the theme.
- User registration:
- wplms_registeration_page : Filters registration page link.
- bp_core_activated_user : Hook runs after user has activated account. Runs the first time the user activates the account.
- user_register: Hook runs after user is registered.
- Course Directory/Taxonomy:
- bp_before_directory_course_list
- bp_before_course_loop
- bp_directory_course_item
- bp_after_directory_course_list
- Course subscription:
- wplms_course_product_id : Filter on Take this course for appropriate course product/membership.
- wplms_course_product_puchased : Runs when Course product is purchased
- wplms_before_start_course : Before user stats a course
- badgeos_wplms_start_course : When a user starts the course
- badgeos_wplms_unit_complete : Runs when user marks unit as complete.
- badgeos_wplms_submit_assignment : After assignment is submitted
- badgeos_wplms_start_quiz : After quiz is started by user
- badgeos_wplms_submit_quiz : After quiz is submitted by user
- badgeos_wplms_evaluate_quiz : Runs after quiz is evaluated
- badgeos_wplms_submit_course : After Course is submitted by user
- badgeos_wplms_evaluate_course : After course is evaluated