I would like to remove the concatenation of the first and last name of the student certificates through the "Sensei LMS Certificates" plug-in. I would like to show only the first name, make an edit in the files * class-woothemes-sensei-certificate.php * and in * class-woothemes-sensei-certificate-tempates *, the file comes with the concatenation like this:
// Get Student Data
$user_id = get_post_meta( $certificate_id, 'learner_id', true );
$student = get_userdata( $user_id );
$student_name = $student->display_name;
$fname = $student->first_name;
$lname = $student->last_name;
if ( '' != $fname && '' != $lname ) {
$student_name = $fname . ' ' . $lname;
}
and I changed it to:
// Get Student Data
$user_id = get_post_meta( $certificate_id, 'learner_id', true );
$student = get_userdata( $user_id );
$student_name = $student->display_name;
$fname = $student->first_name;
$lname = $student->last_name;
if ( '' != $fname && '' != $lname ) {
$student_name = $fname;
}
However, if there is an update to the plug-in, I will lose those settings. I would like to include a function in functions so that certificates are kept only the first name. Could someone help me create this function for my child theme's functions.php file? How can I insert a function in the file that changes this?