Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • i want create 2 or 3 field from user in sql database to certification learnpress i use this under code but this code are fault
    please help me for add 3 field from user such as postalcode and address and fathername
    in certification for one curess

    function shorman_function() {
    return ‘test test’;
    }
    add_shortcode(‘shorman’, ‘shorman_function’);

    add_filter( ‘certificates/fields’, function($fields) {
    $fields[] = array(
    ‘name’ => ‘pedar’,
    ‘icon’ => ‘dashicons-smiley’,
    ‘title’ => __( ‘??? ???’, ‘learnpress-certificates’ )
    );
    return $fields;
    });

    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’ => __( ‘?????’, ‘learnpress-certificates’ )
    );
    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’] . ‘]’);
    //$this->options[‘text’] = do_shortcode(‘[shorman course_id=”‘ . $data[‘course_id’] . ‘]’);
    }

    }
    }
    return $fields;
    });`

    i want create 2 or 3 field from user in sql database to certification learnpress
    i use this under code but this code are fault
    please help me for add 3 field from user such as postalcode and address and fathername
    in certification for one curess

    /* EWS Change - Custom Shortcode */
    function shorman_function() {
        return 'test test';
    }
    add_shortcode('shorman', 'shorman_function');
    
    /* Adds new shortcode option to cert editor */
    add_filter( 'certificates/fields', function($fields) {
            $fields[] = array(
                   'name'  => 'pedar',
                   'icon'  => 'dashicons-smiley',
                   'title' => __( '??? ???', 'learnpress-certificates' )
           );
            return $fields;
    });
     
     
     /* 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' => __( '?????', 'learnpress-certificates' )
           );
    	   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'] . ']');  
    			  //$this->options['text'] = do_shortcode('[shorman course_id="' . $data['course_id'] . ']');
    		  }
    	   
    	   }  
      }
            return $fields;
    });
Viewing 2 replies - 1 through 2 (of 2 total)