Action hookok
A Tutor LMS action hookjai csoportosítva: adminisztrációs felület, osztályok, vezérlőpult és sablonok, a paraméterekkel.
Az action hookokkal a saját kódod a Tutor LMS működésének meghatározott pontján lefut: például egy kurzus befejezésekor, egy kvíz leadásakor vagy egy sablon egy részének kiírása előtt. A kódot add_action( 'hook_neve', 'fuggveny_neve' ); formában add hozzá a gyermektéma functions.php fájljához vagy egy saját bővítményhez.
A Tutor LMS indulásakor a tutor() függvény egy példányt ad vissza, amely tartalmazza a bővítmény elérési útját és URL-jét, a fájlnevét, a verzióját, a nonce-műveletet és a nonce-t, a kurzus- és a leckeposztípust, az oktatói szerepkör nevét, a sablonok útvonalát és azt, hogy van-e Pro. A tutor_utils() a segédfüggvényeket tartalmazó osztályt adja vissza.
A hookokat az alábbi csoportokban találod. Ahol a hook paramétert kap, az a neve után látszik.
Betöltés
Szekció neve “Betöltés”do_action( 'tutor_before_load' );do_action( 'tutor_loaded' );do_action( 'tutor_before_run' );do_action( 'tutor_after_run' );do_action( 'tutor_action_' . $_REQUEST['tutor_action'] );A tutor_action_… hook a kérésben megadott tutor_action értékéhez tartozó egyedi műveletet indítja.
Admin: kurzusszerkesztő és beállítások
Szekció neve “Admin: kurzusszerkesztő és beállítások”// Kurzus kiegészítő adataido_action( 'tutor_course_metabox_before_additional_data' );do_action( 'tutor_course_metabox_after_additional_data' );
// Kurzustartalom a kurzusszerkesztőbendo_action( 'tutor_course_builder_before_quiz_btn_action', $quiz_id );do_action( 'tutor_course_builder_before_btn_group', $topic_id );do_action( 'tutor_course_builder_after_btn_group', $topic_id );do_action( 'tutor_course_builder_metabox_before', $course_id );do_action( 'tutor_course_builder_metabox_after', $course_id );
// Kurzusbeállítások füleido_action( 'tutor_course/settings_tab_content/before', $key, $tab );do_action( "tutor_course/settings_tab_content/before/{$key}", $tab );do_action( 'tutor_course/settings_tab_content/after', $key, $tab );do_action( "tutor_course/settings_tab_content/after/{$key}", $tab );
// Lecke- és kvízszerkesztő ablakdo_action( 'tutor_lesson_edit_modal_form_before', $post );do_action( 'tutor_lesson_edit_modal_form_after', $post );do_action( 'tutor_quiz_edit_modal_info_tab_after', $quiz );do_action( 'tutor_quiz_edit_modal_settings_tab_after', $quiz );
// Beállítások generálása és mentésedo_action( 'tutor_options_before_' . $key );do_action( "tutor_options_{$key}_{$fgKey}_before" );do_action( "tutor_options_{$key}_{$fgKey}_after" );do_action( 'tutor_options_after_' . $key );do_action( 'tutor_option_save_before' );do_action( 'tutor_option_save_after' );
// Új oktató felvétele az adminbando_action( 'tutor_add_new_instructor_form_fields_before' );do_action( 'tutor_add_new_instructor_form_fields_after' );
// Az Eszközök oldal füleido_action( "tutor_tools_page_{$current_page}_before" );do_action( "tutor_tools_page_{$current_page}" );do_action( "tutor_tools_page_{$current_page}_after" );
// Admin regisztrációdo_action( 'tutor_admin_register' );Kurzus, lecke, beiratkozás
Szekció neve “Kurzus, lecke, beiratkozás”do_action( 'tutor_save_course', $post_ID, $post );do_action( 'tutor_save_course_after', $post_ID, $post );do_action( 'tutor_course_complete_before', $course_id );do_action( 'tutor_course_complete_after', $course_id );do_action( 'tutor/course/started', $course_id );
do_action( 'tutor/lesson/created', $lesson_id );do_action( 'tutor/lesson_update/before', $lesson_id );do_action( 'tutor/lesson_update/after', $lesson_id );do_action( 'tutor_lesson_completed_before', $lesson_id );do_action( 'tutor_lesson_completed_after', $lesson_id );do_action( 'tutor_mark_lesson_complete_before', $post_id, $user_id );do_action( 'tutor_mark_lesson_complete_after', $post_id, $user_id );do_action( 'tutor_lesson_load_before', $template );
do_action( 'tutor_is_enrolled_before', $course_id, $user_id );do_action( 'tutor_before_enroll', $course_id );do_action( 'tutor_after_enroll', $course_id, $isEnrolled );do_action( 'tutor/course/enrol_status_change/before', $enrol_id, $new_status );do_action( 'tutor/course/enrol_status_change/after', $enrol_id, $new_status );do_action( 'tutor_quiz/start/before', $quiz_id, $user_id );do_action( 'tutor_quiz/start/after', $quiz_id, $user_id, $attempt_id );do_action( 'tutor_quiz/attempt_analysing/before', $attempt_id );do_action( 'tutor_quiz/attempt_ended', $attempt_id );do_action( 'tutor_quiz_before_finish', $attempt_id, $quiz_id, $user_id );do_action( 'tutor_quiz_finished', $attempt_id, $quiz_id, $user_id );do_action( 'tutor_quiz_timeout', $attempt_id, $quiz_id, $user_id );do_action( 'tutor_quiz_review_answer_before', $attempt_answer_id, $attempt_id, $mark_as );do_action( 'tutor_quiz_review_answer_after', $attempt_answer_id, $attempt_id, $mark_as );do_action( 'tutor_initial_quiz_created', $quiz_id );do_action( 'tutor_delete_quiz_before', $quiz_id );do_action( 'tutor_delete_quiz_after', $quiz_id );do_action( 'tutor_quiz_updated', $quiz_id );do_action( 'tutor_quiz_settings_updated', $quiz_id );Értékelés, kérdések és válaszok
Szekció neve “Értékelés, kérdések és válaszok”do_action( 'tutor_before_rating_placed' );do_action( 'tutor_after_rating_placed', $comment_id );do_action( 'tutor_before_add_question', $course_id );do_action( 'tutor_after_add_question', $course_id, $comment_id );do_action( 'tutor_before_answer_to_question' );do_action( 'tutor_after_answer_to_question', $comment_id );Addonok
Szekció neve “Addonok”do_action( 'tutor_addon_before_enable_disable' );do_action( 'tutor_addon_before_enable', $addonFieldName );do_action( "tutor_addon_before_enable_{$addonFieldName}" );do_action( 'tutor_addon_after_enable', $addonFieldName );do_action( "tutor_addon_after_enable_{$addonFieldName}" );do_action( 'tutor_addon_before_disable', $addonFieldName );do_action( "tutor_addon_before_disable_{$addonFieldName}" );do_action( 'tutor_addon_after_disable', $addonFieldName );do_action( "tutor_addon_after_disable_{$addonFieldName}" );do_action( 'tutor_addon_after_enable_disable' );Felhasználók: bejelentkezés, jelszó, oktatók, profil
Szekció neve “Felhasználók: bejelentkezés, jelszó, oktatók, profil”do_action( 'tutor_login_failed' );do_action( 'tutor_reset_password_notification', $user_login, $key );do_action( 'tutor_user_reset_password', $user );do_action( 'tutor_user_reset_password_login', $user );
do_action( 'tutor_new_instructor_after', $user_id );do_action( 'tutor_add_new_instructor_before' );do_action( 'tutor_add_new_instructor_after', $user_id );do_action( 'tutor_before_approved_instructor', $instructor_id );do_action( 'tutor_after_approved_instructor', $instructor_id );do_action( 'tutor_before_blocked_instructor', $instructor_id );do_action( 'tutor_after_blocked_instructor', $instructor_id );
do_action( 'tutor_profile_update_before' );do_action( 'tutor_profile_update_after', $user_id );A jelszó-visszaállításnál a Tutor a WordPress saját lostpassword_post, retrieve_password és password_reset hookjait is meghívja.
Pénzfelvétel
Szekció neve “Pénzfelvétel”do_action( 'tutor_withdraw_options_save_before' );do_action( 'tutor_withdraw_options_save_after' );do_action( 'tutor_withdraw_before' );do_action( 'tutor_insert_withdraw_before', $withdraw_data );do_action( 'tutor_insert_withdraw_after', $withdraw_id, $withdraw_data );do_action( 'tutor_withdraw_after' );do_action( 'tutor_before_delete_withdraw', $withdraw_id );do_action( 'tutor_after_delete_withdraw', $withdraw_id );do_action( 'tutor_before_approved_withdraw', $withdraw_id );do_action( 'tutor_after_approved_withdraw', $withdraw_id );do_action( 'tutor_before_rejected_withdraw', $withdraw_id );do_action( 'tutor_after_rejected_withdraw', $withdraw_id );do_action( 'tutor_withdraw_form_before' );do_action( 'tutor_withdraw_form_after' );do_action( 'tutor_withdraw_set_account_form_before' );do_action( "tutor_withdraw_set_account_{$method_id}_before" );do_action( "tutor_withdraw_set_account_{$method_id}_after" );do_action( 'tutor_withdraw_set_account_form_after' );Vezérlőpult
Szekció neve “Vezérlőpult”// Kurzuskészítő (frontend)do_action( 'tutor_load_template_before', 'dashboard.create-course', null );do_action( 'tutor/dashboard_course_builder_before' );do_action( 'tutor/dashboard_course_builder_form_field_before' );do_action( 'tutor/frontend_course_edit/after/description', $post );do_action( 'tutor/dashboard_course_builder_form_field_after' );do_action( 'tutor/dashboard_course_builder_after' );do_action( 'tutor_load_template_after', 'dashboard.create-course', null );
// A vezérlőpult keretedo_action( 'tutor_dashboard/before/wrap' );do_action( 'tutor_load_dashboard_template_before', $dashboard_page_name );do_action( 'tutor_load_dashboard_template_after', $dashboard_page_name );do_action( 'tutor_dashboard/after/wrap' );
// Kvízpróbálkozások táblázatado_action( 'tutor_quiz/my_attempts/table/thead/col' );do_action( 'tutor_quiz/my_attempts/table/tbody/col' );
// Profil szerkesztésedo_action( 'tutor_profile_edit_form_before' );do_action( 'tutor_profile_edit_input_before' );do_action( 'tutor_profile_edit_input_after' );do_action( 'tutor_profile_edit_form_after' );
// Jelszó visszaállításado_action( 'tutor_reset_password_input_before' );do_action( 'tutor_reset_password_input_after' );do_action( 'tutor_before_reset_password_form' );do_action( 'tutor_reset_password_form' );do_action( 'tutor_after_reset_password_form' );Sablonok általában
Szekció neve “Sablonok általában”do_action( 'tutor_load_template_before', $template, $variables );do_action( 'tutor_load_template_after', $template, $variables );do_action( 'tutor_lesson_next_previous_pagination_before' );do_action( 'tutor_lesson_next_previous_pagination_after' );do_action( 'tutor/template/login/before/wrap' );do_action( 'tutor/template/login/after/wrap' );do_action( 'tutor_student/before/wrap' );do_action( 'tutor_student/after/wrap' );do_action( 'tutor_global/before/attachments' );do_action( 'tutor_global/after/attachments' );Kurzusarchívum és kurzuskártya
Szekció neve “Kurzusarchívum és kurzuskártya”do_action( 'tutor_course/archive/before_loop' );do_action( 'tutor_course/archive/before_loop_course' );do_action( 'tutor_course/archive/after_loop_course' );do_action( 'tutor_course/archive/after_loop' );do_action( 'tutor_course/archive/pagination/before' );do_action( 'tutor_course/archive/pagination/after' );
// A kurzuskártya részei, fentről lefelédo_action( 'tutor_course/loop/before_content' );do_action( 'tutor_course/loop/badge' );do_action( 'tutor_course/loop/before_header' );do_action( 'tutor_course/loop/header' );do_action( 'tutor_course/loop/after_header' );do_action( 'tutor_course/loop/start_content_wrap' );do_action( 'tutor_course/loop/before_rating' );do_action( 'tutor_course/loop/rating' );do_action( 'tutor_course/loop/after_rating' );do_action( 'tutor_course/loop/before_title' );do_action( 'tutor_course/loop/title' );do_action( 'tutor_course/loop/after_title' );do_action( 'tutor_course/loop/before_meta' );do_action( 'tutor_course/loop/meta' );do_action( 'tutor_course/loop/after_meta' );do_action( 'tutor_course/loop/before_excerpt' );do_action( 'tutor_course/loop/excerpt' );do_action( 'tutor_course/loop/after_excerpt' );do_action( 'tutor_course/loop/end_content_wrap' );do_action( 'tutor_course/loop/before_footer' );do_action( 'tutor_course/loop/footer' );do_action( 'tutor_course/loop/after_footer' );do_action( 'tutor_course/loop/after_content' );Egy kurzus oldala
Szekció neve “Egy kurzus oldala”// A kurzus oldalának keretedo_action( 'tutor_course/single/before/wrap' );do_action( 'tutor_course/single/before/inner-wrap' );do_action( 'tutor_course/single/after/inner-wrap' );do_action( 'tutor_course/single/before/sidebar' );do_action( 'tutor_course/single/after/sidebar' );do_action( 'tutor_course/single/after/wrap' );
// A kurzus részeido_action( 'tutor_course/single/title/before' );do_action( 'tutor_course/single/title/after' );do_action( 'tutor_course/single/lead_meta/before' );do_action( 'tutor_course/single/lead_meta/after' );do_action( 'tutor_course/single/excerpt/before' );do_action( 'tutor_course/single/excerpt/after' );do_action( 'tutor_course/single/before/benefits' );do_action( 'tutor_course/single/after/benefits' );do_action( 'tutor_course/single/before/content' );do_action( 'tutor_course/single/after/content' );do_action( 'tutor_course/single/before/requirements' );do_action( 'tutor_course/single/after/requirements' );do_action( 'tutor_course/single/before/audience' );do_action( 'tutor_course/single/after/audience' );do_action( 'tutor_course/single/before/topics' );do_action( 'tutor_course/single/after/topics' );do_action( 'tutor_course/single/before/material_includes' );do_action( 'tutor_course/single/after/material_includes' );do_action( 'tutor_course/single/before/tags' );do_action( 'tutor_course/single/after/tags' );
// Beiratkozásdo_action( 'tutor_course/single/enroll_box/after_thumbnail' );do_action( 'tutor_course/single/add-to-cart/before' );do_action( 'tutor_course/single/add-to-cart/after' );do_action( 'tutor_before_add_to_cart_button' );do_action( 'tutor_after_add_to_cart_button' );do_action( 'tutor_course/single/closed-enrollment/before' );do_action( 'tutor_course/single/closed-enrollment/after' );
// Befejezésdo_action( 'tutor_course/single/before/complete_form' );do_action( 'tutor_course/single/after/complete_form' );Beiratkozott hallgató nézete
Szekció neve “Beiratkozott hallgató nézete”A beiratkozott hallgató kurzusoldalán a következő hookok állnak rendelkezésre (az áttekintés, a kérdések és a további aloldalak sablonjaiban).
do_action( 'tutor_course/single/enrolled/before/wrap' );do_action( 'tutor_course/single/enrolled/before/inner-wrap' );do_action( "tutor_course/single/enrolled/{$course_subpage}", $course_id );do_action( 'tutor_course/single/enrolled/after/inner-wrap' );do_action( 'tutor_course/single/enrolled/before/sidebar' );do_action( 'tutor_course/single/enrolled/after/sidebar' );do_action( 'tutor_course/single/enrolled/after/wrap' );
do_action( 'tutor_course/single/enrolled/before/instructors' );do_action( 'tutor_course/single/enrolled/after/instructors' );do_action( 'tutor_course/single/enrolled/before/reviews' );do_action( 'tutor_course/single/enrolled/after/reviews' );do_action( 'tutor_course/single/enrolled/before/lead_info/progress_bar' );do_action( 'tutor_course/single/enrolled/after/lead_info/progress_bar' );do_action( 'tutor_course/single/enrolled/nav/before' );do_action( 'tutor_course/single/enrolled/nav/after' );do_action( 'tutor_course/single/actions_btn_group/before' );do_action( 'tutor_course/single/actions_btn_group/after' );do_action( 'tutor_enrolled_box_after' );do_action( 'tutor_course/announcements/before' );do_action( 'tutor_course/announcements/after' );do_action( 'tutor_course/question_and_answer/before' );do_action( 'tutor_course/question_and_answer/after' );Lecke, feladat és kvíz oldala
Szekció neve “Lecke, feladat és kvíz oldala”// Leckedo_action( 'tutor_lesson/single/before/wrap' );do_action( 'tutor_lesson/single/after/wrap' );do_action( 'tutor_lesson/single/before/content' );do_action( 'tutor_lesson/single/after/content' );do_action( 'tutor_lesson/single/before/lesson_sidebar' );do_action( 'tutor/lesson_list/before/topic', $topic_id );do_action( 'tutor/lesson_list/right_icon_area', $post );do_action( 'tutor/lesson_list/after/topic', $topic_id );do_action( 'tutor_lesson/single/after/lesson_sidebar' );do_action( 'tutor_lesson/single/before/complete_form' );do_action( 'tutor_lesson/single/after/complete_form' );
// Lecke videóido_action( 'tutor_lesson/single/before/video' );do_action( 'tutor_lesson/single/after/video' );do_action( 'tutor_lesson/single/before/video/embedded' );do_action( 'tutor_lesson/single/after/video/embedded' );do_action( 'tutor_lesson/single/before/video/external_url' );do_action( 'tutor_lesson/single/after/video/external_url' );do_action( 'tutor_lesson/single/before/video/html5' );do_action( 'tutor_lesson/single/after/video/html5' );do_action( 'tutor_lesson/single/before/video/vimeo' );do_action( 'tutor_lesson/single/after/video/vimeo' );do_action( 'tutor_lesson/single/before/video/youtube' );do_action( 'tutor_lesson/single/after/video/youtube' );
// Feladatdo_action( 'tutor_assignment/single/before/wrap' );do_action( 'tutor_assignment/single/after/wrap' );do_action( 'tutor_assignment/single/before/content' );do_action( 'tutor_assignment/single/after/content' );
// Kvízdo_action( 'tutor_quiz/single/before/wrap' );do_action( 'tutor_quiz/body/before', $quiz_id );do_action( 'tutor_quiz/start_form/before', $quiz_id );do_action( 'tutor_quiz/start_form/after', $quiz_id );do_action( 'tutor_quiz/previous_attempts_html/before', $previous_attempts, $quiz_id );do_action( 'tutor_quiz/previous_attempts/after', $previous_attempts, $quiz_id );do_action( 'tutor_quiz/body/after', $quiz_id );do_action( 'tutor_quiz/content/before', $quiz_id );do_action( 'tutor_quiz/content/after', $quiz_id );do_action( 'tutor_quiz/previous_attempts/table/thead/col' );do_action( 'tutor_quiz/previous_attempts/table/tbody/col', $attempt );do_action( 'tutor_quiz/single/before/top' );do_action( 'tutor_quiz/single/after/top' );A sablon-hookok pontos helye a Tutor LMS aktuális sablonfájljaitól függ: ha egy hook nem hívódik meg, nézd meg a bővítmény templates mappájában, melyik sablon használja.
Készült: