Skip to content

Instantly share code, notes, and snippets.

@lelandf
Created August 23, 2022 19:47
Show Gist options
  • Save lelandf/21535fa7e3f38cbfc45e9b74a489d0fe to your computer and use it in GitHub Desktop.
Save lelandf/21535fa7e3f38cbfc45e9b74a489d0fe to your computer and use it in GitHub Desktop.
LearnDash: Change the "Sample Lesson" string to something else
<?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