Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lelandf/6d74e95628714035a6c2aa5a70ca0397 to your computer and use it in GitHub Desktop.
Save lelandf/6d74e95628714035a6c2aa5a70ca0397 to your computer and use it in GitHub Desktop.
Undisable Mark Complete button if Video Progression setting is disabling it
/* 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