This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
add_action( 'pre_get_posts', 'llms_wc_remove_products_from_public_query' ); | |
function llms_wc_remove_products_from_public_query( $query ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
// only a temporary measure, remove once https://github.com/pojome/elementor/issues/5900 is resolved | |
add_filter( 'lifterlms_register_post_type_lesson' , 'llms_lesson_elementor_template_compatibility' ); | |
function llms_lesson_elementor_template_compatibility( $lesson_post_type_params ) { | |
/* | |
* see https://github.com/gocodebox/lifterlms/blob/master/includes/class.llms.post-types.php#L223 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
/* | |
* This code is not perfect and returns more than one result for the same user. | |
* I'll take another stab at this to fix that. | |
* Also, this is not likely to work that well in case a user is enrolled in more than one membership. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
function llms_course_name_in_body_class( $classes ) { | |
// bail early, if we're not on a lesson. | |
if( ! is_singular ( 'lesson' ) ){ | |
return $classes; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line. | |
// Copy from under this line and paste into your child theme's functions.php. | |
// replace the default redirect_url. | |
add_filter( 'lifterlms_completed_transaction_redirect', 'llms_custom_checkout_post_checkout_redirection', 10, 2 ); | |
function llms_custom_checkout_post_checkout_redirection( $original_redirect, $order ) { | |
// only proceed if the order has been for a particualr membership. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line. | |
// Copy from under this line and paste into your child theme's functions.php. | |
add_filter( 'lifterlms_get_person_fields', 'llms_remove_state_field', 10, 2); | |
function llms_remove_state_field( $fields , $screen ){ | |
if( strcmp( $screen , 'checkout' ) == 0 || | |
strcmp( $screen , 'registration' ) == 0) { | |
$fields = array_filter( $fields, 'llms_is_not_state_field' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line | |
// Copy from under this line and paste into your child theme's functions.php | |
add_action( 'llms_user_enrolled_in_course', 'llms_enroll_in_prerequisite_course', 10, 2 ); | |
function llms_enroll_in_prerequisite_course( $student_id, $course_id ){ | |
/* | |
* the prerequiste course's id. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.llms-syllabus-wrapper .llms-section-title { | |
cursor: pointer; | |
} | |
.llms-syllabus-wrapper .llms-section-title::after { | |
content: "\25b6"; | |
float: left; | |
display: inline-block; | |
width: 15px; | |
text-align: left; | |
margin-right: 15px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'llms_user_enrolled_in_course', 'llms_autocomplete_section', 10, 2 ); | |
function llms_autocomplete_section( $student_id, $course_id ){ | |
// only do this for a particular course. | |
if( (int) $course_id != 1051 ){ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //don't copy-paste this line | |
// copy-paste from under here--> | |
// complete | |
remove_action( 'lifterlms_course_completed', array( 'LLMS_SL_Stories', 'complete' ), 25, 2 ); | |
// earn achievement( badges, certificates, etc) | |
remove_action( 'llms_user_earned_achievement', array( 'LLMS_SL_Stories', 'achievement' ), 25, 3 ); |