Add custom fields to certificate
-
Hello, I use LearnPress with the Certificates addon and I need to add custom fields to my certificate, such as “CPF”. They all come from the checkout custom fields (see images). How can I add them to the certificate?
I found the following code on the forum, but I can’t assign the “CPF” to the code.
/* EWS Change - Custom Shortcode */ function lporderid_function() { return 'test'; } add_shortcode('lporderid', 'lporderid_function'); /* Adds new shortcode option to cert editor */ add_filter( 'certificates/fields', function($fields) { $fields[] = array( 'name' => 'shortcode', 'icon' => 'dashicons-smiley', 'title' => __( 'Shortcode', 'learnpress-certificates' ) ); return $fields; }); if (class_exists('LP_Certificate_Layer')) { class LP_Certificate_Shortcode_Layer extends LP_Certificate_Layer { public function apply( $data ) { $this->options['text'] = do_shortcode('[lporderid course_id="' . $data['course_id'] . ']'); } } }
Thanks for your help.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add custom fields to certificate’ is closed to new replies.