Skip to content

Instantly share code, notes, and snippets.

@khleomix
Created September 6, 2024 15:05
Show Gist options
  • Save khleomix/a3482e7cffd1743cb070cafe5c131517 to your computer and use it in GitHub Desktop.
Save khleomix/a3482e7cffd1743cb070cafe5c131517 to your computer and use it in GitHub Desktop.
LD Course Point remove decimals
function custom_remove_decimals_from_course_points( $output, $atts ) {
if ( isset( $atts['show'] ) && $atts['show'] == 'course_points' ) {
// Remove decimal points by casting to an integer
$output = intval( $output );
}
return $output;
}
add_filter( 'learndash_course_info', 'custom_remove_decimals_from_course_points', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment