Skip to content

Instantly share code, notes, and snippets.

@actual-saurabh
actual-saurabh / llms-certificate-custom-merge-codes.php
Created April 2, 2019 15:47
LifterLMS Custom Merge Codes for Certificates
<?php // Do not copy this line
// Copy from under this line and paste into your child theme's functions.php
add_filter( 'llms_certificate_merge_codes', 'llms_custom_certificate_prefix_suffix_merge_codes', 10, 2 );
function llms_custom_certificate_title_merge_code( $merge_codes_array, $certificate_object ){
// add custom certificate title merge code to existing ones. See https://github.com/gocodebox/lifterlms/blob/a1a6833c6e6bab57bf4356739463220e51f89408/includes/certificates/class.llms.certificate.user.php#L132
$merge_codes_array['{merge-code-1}'] = get_user_meta( $certificate_object->user_id, 'custom_field_key_1', true );