Created
April 11, 2020 19:04
-
-
Save lelandf/6d74e95628714035a6c2aa5a70ca0397 to your computer and use it in GitHub Desktop.
Undisable Mark Complete button if Video Progression setting is disabling it
This file contains hidden or 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
/* No warranty/support offered */ | |
/* Please test on staging/development site to ensure it meets your needs before applying to production */ | |
function leland_learndash_video_progression_mark_complete_undisabler() { | |
if ( is_singular( 'sfwd-lessons' ) || is_singular( 'sfwd-topic' ) ) { | |
?> | |
<script> | |
jQuery( document ).ready( function( $ ) { | |
$(document).on( 'learndash_video_disable_assets', function( event, status ) { | |
if ( true === status ) { | |
LearnDash_disable_assets( false ); | |
} | |
}); | |
} ); | |
</script> | |
<?php | |
} | |
} | |
// This script must be output below the references to learndash.js and learndash_video_script.js | |
add_action( 'wp_footer', 'leland_learndash_video_progression_mark_complete_undisabler', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment