• Resolved mixweb

    (@mixweb)


    The certificate does not show a custom shortcode to print the company name.
    Tested the shortcode in other areas the result is displayed normally.

    function get_company_name_user() {
    	$user = wp_get_current_user();
    	$result = get_user_meta( $user->ID, 'llms_company_name', true );
    	return $result;
    }
    add_shortcode('company-name', 'get_company_name_user');

    Detail in preview mode the shortcode result is shown.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Rocco Aliberti

    (@d4z_c0nf)

    Hi @mixweb
    Thanks for reporting this.
    Can you give us more information? E.g. what does it show? Nothing or the shortcode as it is? Are you using the shortcode block or what?

    Consider that you’re using the current logged user information, not necessarily the the information of the user who awarded the certificate.

    Have you tried using custom merge codes instead? E.g.

    
    add_filter(
    	'llms_certificate_merge_data',
    	function( $codes, $user_id ) {
    		$codes['{company-name}'] = get_user_meta( $user_id, 'llms_company_name', true );
    		return $codes;
    	},
    	10,
    	2
    );
    
    Thread Starter mixweb

    (@mixweb)

    With merge code the data is being displayed correctly.
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Certificate does not show custom Shortcode’ is closed to new replies.