Created
August 23, 2022 19:47
-
-
Save lelandf/21535fa7e3f38cbfc45e9b74a489d0fe to your computer and use it in GitHub Desktop.
LearnDash: Change the "Sample Lesson" string to something else
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 | |
// Change 'Sample Lesson' to exactly how the text appears on your site. | |
// This could change depending on your use of Custom Labels and translations | |
// Change 'Free Module' to whatever you want to replace it with | |
add_filter( 'learndash_course_step_attributes', function( $attributes ) { | |
if ( | |
isset( $attributes[0]['label'] ) && | |
'Sample Lesson' === $attributes[0]['label'] | |
) { | |
$attributes[0]['label'] = 'Free Module'; | |
} | |
return $attributes; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment