learndash_get_course_id( WP_Post|int|null $id = null, boolean $bypass_cb = false )
Gets the course ID for a resource.
Description #
Determine the type of ID being passed. Should be the ID of anything that belongs to a course (Lesson, Topic, Quiz, etc)
Parameters #
- $id
-
(WP_Post|int|null) (Optional) ID of the resource.
Default value: null
- $bypass_cb
-
(boolean) (Optional) If true will bypass course_builder logic.
Default value: false
Return #
(int|bool) ID of the course.
Source #
Changelog #
Version | Description |
---|---|
2.5.0 | Added the $bypass_cb parameter. |
2.1.0 | Introduced. |
Related #
Namespace #
@package #
Uses #
Uses | Description |
---|---|
includes/course/ld-course-functions.php: learndash_is_course_shared_steps_enabled () |
Utility function to check if Course Shared steps is enabled. |
includes/class-ldlms-post-types.php: learndash_get_post_types () | |
includes/class-ldlms-post-types.php: learndash_get_post_type_slug () | |
includes/course/ld-course-functions.php: learndash_get_page_by_path () |
Gets the page data by page path. |
Used By #
Used By | Description |
---|---|
includes/ld-assignment-uploads.php: learndash_assignment_list_approved () |
Checks whether all assignments for specified step and user are approved. |
themes/ld30/includes/helpers.php: learndash_get_course_step_attributes () |
Gets the course step attributes. |
includes/ld-misc-functions.php: learndash_get_user_profile_quiz_attempts () |
Gets the user’s quiz attempts for the ld_profile shortcode/block |
includes/shortcodes/ld_infobar.php: learndash_infobar_shortcode () |
Builds the |
includes/shortcodes/ld_navigation.php: learndash_navigation_shortcode () |
Builds the |
includes/gutenberg/blocks/ld-infobar/index.php: LearnDash_Gutenberg_Block_Infobar::render_block () |
Render Block |
includes/course/ld-course-progress.php: learndash_is_quiz_accessable () |
Checks if the quiz is accessible to the user. |
includes/course/ld-course-functions-legacy.php: learndash_is_topic_notcomplete_legacy () |
LEGACY: Checks if a topic is not complete. |
includes/course/ld-course-functions-legacy.php: learndash_is_quiz_accessable_legacy () |
Checks if the quiz is accessible to the user (legacy). |
includes/course/ld-course-functions-legacy.php: learndash_get_course_progress_legacy () |
LEGACY: Gets the user’s current course progress. |
includes/course/ld-course-functions-legacy.php: learndash_process_mark_complete_legacy () |
LEGACY: Updates the user meta with completion status for any resource. |
includes/course/ld-course-functions-legacy.php: learndash_get_course_lessons_list_legacy () |
LEGACY: Gets the lesson list output for a course. |
includes/course/ld-course-functions-legacy.php: learndash_get_topic_list_legacy () |
LEGACY: Gets the topics list for a lesson. |
includes/course/ld-course-functions-legacy.php: learndash_get_course_quiz_list_legacy () |
LEGACY: Gets the quiz list output for a course. |
includes/course/ld-course-functions-legacy.php: learndash_get_lesson_quiz_list_legacy () |
LEGACY: Gets the quiz list output for a lesson. |
includes/course/ld-course-functions-legacy.php: learndash_get_global_quiz_list_legacy () |
LEGACY: Gets the quiz list for a resource. |
includes/course/ld-course-functions-legacy.php: learndash_is_lesson_notcomplete_legacy () |
LEGACY: Checks if a lesson is not complete. |
includes/course/ld-course-progress.php: learndash_can_complete_step () |
Check if the user can complete the current step. |
includes/course/ld-course-video.php: Learndash_Course_Video::check_video_complete () |
Utility class method to allow add-hoc checks on video complete. |
includes/admin/class-learndash-admin-posts-listing.php: Learndash_Admin_Posts_Listing::show_column_step_lesson () |
Show Lesson column for Step. |
includes/admin/class-learndash-admin-posts-listing.php: Learndash_Admin_Posts_Listing::show_column_step_topic () |
Show Topic column for Step. |
includes/admin/class-learndash-admin-posts-listing.php: Learndash_Admin_Posts_Listing::show_column_step_lesson_or_topic () |
Show Lesson or Topic column for Step. |
includes/admin/class-learndash-admin-posts-listing.php: Learndash_Admin_Posts_Listing::show_column_step_quiz () |
Show Quiz column for Step. |
includes/course/ld-course-functions.php: learndash_is_course_prerequities_completed () |
Checks if the user’s course prerequisites are completed for a given course. |
themes/ld30/includes/helpers.php: learndash_30_has_lesson_quizzes () |
Gets whether the lesson has quiz or not. |
themes/ld30/includes/helpers.php: learndash_30_has_topics () |
Gets whether a lesson has topics or not. |
themes/ld30/includes/helpers.php: learndash_30_get_course_sections () |
Gets the ld30 theme course sections. |
themes/ld30/includes/helpers.php: learndash_30_focus_mode_can_complete () |
Checks whether a post can be marked as complete or not in focus mode. |
themes/ld30/includes/helpers.php: learndash_is_item_complete () |
Checks if any LearnDash content type is complete. |
themes/ld30/includes/helpers.php: learndash_lesson_progress () |
Gets the Lesson Progress. |
themes/ld30/includes/helpers.php: learndash_get_breadcrumbs () |
Gets the breadcrumbs hierarchy. |
themes/ld30/includes/login-register-functions.php: learndash_add_login_field_top () |
Adds a hidden form field to the login form. |
includes/ld-misc-functions.php: learndash_body_classes () |
Adds custom classes to the body. |
includes/settings/settings-functions.php: learndash_get_setting () |
Gets the LearnDash setting for a post. |
includes/shortcodes/ld_payment_buttons.php: learndash_payment_buttons_shortcode () |
Builds the |
includes/ld-misc-functions.php: learndash_is_sample () |
Checks if a lesson, topic, or quiz is a sample or not. |
includes/shortcodes/ld_course_certificate.php: ld_course_certificate_shortcode () |
Builds the |
includes/deprecated/3.4.1/functions.php: learndash_assignment_migration () |
Migrates the assignments from post meta to assignments custom post type. |
includes/ld-assignment-uploads.php: learndash_assignment_process_init () |
Handles the upload, delete, and mark as complete for the assignment. |
includes/ld-assignment-uploads.php: learndash_get_user_assignments () |
Gets a list of user’s assignments. |
includes/ld-assignment-uploads.php: learndash_upload_assignment_init () |
Handles assignment uploads. |
includes/widgets/ld_lesson.php: Lesson_Widget::widget () |
Displays widget |
includes/class-ld-cpt.php: SFWD_CPT::loop_shortcode () |
Shortcode that generates a list of items in this post type |
includes/class-ld-cpt.php: SFWD_CPT::show_content () |
To show content or not |
includes/class-ld-lms.php: SFWD_LMS::select_a_lesson () |
Makes wp_query to retrieve lessons a course |
includes/class-ld-lms.php: SFWD_LMS::quiz_export_init () |
Export quiz data to CSV |
includes/class-ld-lms.php: SFWD_LMS::select_a_lesson_or_topic () |
Makes wp_query to retrieve lessons or topics for a course |
includes/class-ld-permalinks.php: LearnDash_Permalinks::get_edit_post_link () |
Override WordPress Get Edit Post Link to include nested URL. |
includes/class-ld-permalinks.php: LearnDash_Permalinks::comment_form_top () |
Action for comment form when nested URLs are enabled. This way the user is returned to this course step URL |
includes/class-ld-permalinks.php: LearnDash_Permalinks::post_type_link () |
This second filter will correct calls to the WordPress get_permalink() function to use the new structure |
includes/class-ld-cpt-instance.php: SFWD_CPT_Instance::template_redirect_access () |
Show course completion/quiz completion Action callback from ‘template_redirect’ (wp core action) |
includes/class-ld-cpt-instance.php: SFWD_CPT_Instance::template_content () |
Generate output for courses, lessons, topics, quizzes Filter callback for ‘the_content’ (wp core filter) |
includes/shortcodes/ld_certificate.php: ld_certificate_shortcode () |
Builds the |
includes/shortcodes/ld_course_resume.php: ld_course_resume_shortcode () |
Builds the |
includes/shortcodes/ld_quiz_complete.php: ld_quiz_complete_shortcode () |
Builds the |
includes/quiz/ld-quiz-pro.php: LD_QuizPro::wp_pro_quiz_completed () |
This function runs when a quiz is completed, and does the action ‘wp_pro_quiz_completed_quiz’ |
includes/quiz/ld-quiz-essays.php: learndash_update_quiz_data () |
Updates the user’s quiz data. |
includes/quiz/ld-quiz-essays.php: learndash_add_new_essay_response () |
Adds a new essay response. |
includes/shortcodes/ld_courseinfo.php: learndash_courseinfo () |
Builds the |
includes/lib/wp-pro-quiz/lib/view/WpProQuiz_View_FrontQuiz.php: WpProQuiz_View_FrontQuiz::max_question_script () | |
includes/lib/wp-pro-quiz/lib/controller/WpProQuiz_Controller_Front.php: WpProQuiz_Controller_Front::ajaxQuizLoadData () | |
includes/gutenberg/lib/enqueue-scripts.php: learndash_editor_scripts () |
Enqueues block editor styles and scripts. |
includes/gutenberg/blocks/ld-payment-buttons/index.php: LearnDash_Gutenberg_Payment_Buttons::render_block () |
Render Block |
includes/gutenberg/blocks/ld-certificate/index.php: LearnDash_Gutenberg_Block_Certificate::render_block () |
Render Block |
includes/gutenberg/blocks/ld-course-content/index.php: LearnDash_Gutenberg_Block_Course_Content::render_block () |
Render Block |
includes/course/ld-course-functions.php: learndash_get_course_prerequisite_compare () |
Gets the prerequisites compare value for a course. |
includes/course/ld-course-functions.php: learndash_get_course_points_enabled () |
Checks if the course points are enabled for a course. |
includes/course/ld-course-functions.php: learndash_get_course_points () |
Gets the course points for a given course ID. |
includes/course/ld-course-functions.php: learndash_get_course_points_access () |
Gets the course points access for a given course ID. |
includes/course/ld-course-functions.php: learndash_check_user_course_points_access () |
Checks if a user can access course points. |
includes/shortcodes/ld_course_content.php: learndash_course_content_shortcode () |
Builds the |
includes/course/ld-course-functions.php: learndash_get_course_prerequisites () |
Gets the list of course prerequisites and its status for a course. |
includes/course/ld-course-functions.php: learndash_get_course_prerequisite_enabled () |
Checks whether the prerequisites are enabled for a course. |
includes/course/ld-course-functions.php: learndash_get_lesson_id () |
Gets the lesson ID of a resource. |
includes/course/ld-course-navigation.php: learndash_get_course_lessons_list () |
Gets the lesson list output for a course. |
includes/course/ld-course-navigation.php: learndash_get_course_quiz_list () |
Gets the quiz list output for a course. |
includes/course/ld-course-navigation.php: learndash_get_lesson_quiz_list () |
Gets the quiz list output for a lesson/topic. |
includes/course/ld-course-navigation.php: learndash_get_global_quiz_list () |
Gets the quiz list for a resource. |
includes/course/ld-course-functions-legacy.php: learndash_get_lesson_list () |
Gets the lesson list for a course. |
includes/course/ld-course-navigation.php: learndash_previous_post_link () |
Generates the previous post link for lesson or topic. |
includes/course/ld-course-navigation.php: learndash_next_post_link () |
Generates the next post link for lesson or topic. |
includes/course/ld-course-navigation.php: learndash_quiz_continue_link () |
Outputs the quiz continue link. |
includes/course/ld-course-navigation.php: learndash_topic_dots () |
Outputs the LearnDash topic dots. |
includes/course/ld-course-navigation.php: learndash_get_topic_list () |
Gets the topics list for a lesson. |
includes/course/ld-course-progress.php: learndash_remove_user_quiz_attempt () |
Removes the quiz attempt meta for a given user. |
includes/course/ld-course-progress.php: learndash_show_mark_incomplete () |
Outputs HTML output to mark a step incomplete. |
includes/course/ld-course-progress.php: learndash_mark_incomplete_process () |
Processes the request to mark a course or step incomplete. |
includes/course/ld-course-progress.php: learndash_forced_lesson_time_cookie_key () |
Gets the lesson time cookie key for lesson/topic. |
includes/course/ld-course-progress.php: learndash_next_global_quiz () |
Gets the next quiz for a course. |
includes/course/ld-course-progress.php: learndash_next_lesson_quiz () |
Gets the next quiz for current lesson for a user. |
includes/course/ld-course-progress.php: learndash_lesson_progression_enabled () |
Checks whether the lesson progression is enabled or not. |
includes/shortcodes/ld_course_progress.php: learndash_course_progress () |
Builds the |
includes/course/ld-course-progress.php: learndash_process_mark_complete () |
Updates the user meta with completion status for any resource. |
includes/course/ld-course-progress.php: learndash_is_quiz_notcomplete () |
Checks whether a quiz is not completed for a user. |
includes/course/ld-course-progress.php: learndash_get_course_progress () |
Gets the user’s current course progress. |
includes/course/ld-course-progress.php: learndash_is_lesson_notcomplete () |
Checks if a lesson is not complete. |
includes/course/ld-course-progress.php: learndash_is_topic_notcomplete () |
Checks if a topic is not complete. |
includes/widgets/ld_course_navigation.php: LearnDash_Course_Navigation_Widget::widget () |
Displays widget |
includes/course/ld-course-progress.php: learndash_mark_complete () |
Outputs the HTML output to mark a course complete. |
includes/course/ld-course-progress.php: learndash_mark_complete_process () |
Processes a request to mark a course complete. |
includes/course/ld-course-progress.php: learndash_get_course_url () |
Gets the course permalink. |
includes/course/ld-course-progress.php: learndash_get_next_lesson_redirect () |
Redirects the user to next lesson. |
includes/course/ld-course-progress.php: learndash_quiz_redirect () |
Redirects the user after quiz completion. |
includes/course/ld-course-video.php: Learndash_Course_Video::add_video_to_content () |
Hook into the LearnDash template logic to insert the Video Progression output |
includes/course/ld-course-info-widget.php: learndash_course_navigation_admin_box_content () |
Adds the content to the course navigation meta box for admin. |
includes/shortcodes/ld_course_expire_status.php: learndash_course_expire_status_shortcode () |
Builds the |
includes/shortcodes/ld_course_list.php: learndash_course_status_content_shortcode () |
Generates the output for course status shortcodes. |
includes/shortcodes/ld_student.php: learndash_student_check_shortcode () |
Builds the |
includes/shortcodes/ld_visitor.php: learndash_visitor_check_shortcode () |
Builds the |
includes/shortcodes/ld_course_list.php: ld_course_list () |
Builds the |
includes/admin/classes-data-upgrades-actions/class-learndash-admin-data-upgrades-user-meta-quizzes.php: Learndash_Admin_Data_Upgrades_User_Meta_Quizzes::convert_user_meta_quizzes_progress_to_activity () |
Convert single user quiz attempts to Activity DB entries. |