Skip to content

Instantly share code, notes, and snippets.

@danielcharrua
Last active March 10, 2022 18:21
Show Gist options
  • Save danielcharrua/7619e022c0ae8ef5c9a7ebb5937ee34b to your computer and use it in GitHub Desktop.
Save danielcharrua/7619e022c0ae8ef5c9a7ebb5937ee34b to your computer and use it in GitHub Desktop.
Change default LearDash tooltip message on lesson when course is closed
<?php
/**
* Change lesson tooltip
* https://themespirit.com/kb/learndash-changing-tooltips/
*/
add_filter( 'learndash_lesson_row_atts', function( $data_tooltip, $lesson_id, $course_id, $user_id ) {
if ( ! empty( $data_tooltip ) ) {
$data_tooltip = 'data-ld-tooltip="' . esc_html__( "Actualmente no tienes acceso a este contenido. Por favor canjea el código.", 'learndash' ) . '"';
}
return $data_tooltip;
}, 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment