LearnDash is a popular WordPress plugin that allows you to create and manage online courses. One of the features of LearnDash is the ability to add custom fields to the registration form. Custom fields allow you to collect additional information from your users during registration, such as their phone number or company name.

Here is a step-by-step guide on how to add custom fields to the LearnDash registration form:

 

function my_ld_custom_fields() { 
    // Create a new custom field : Name 
    $custom_fields[] = array( 
        'name' => 'your_name',
        'label' => 'Your Name',
        'type' => 'text',
        'required' => true 
    ); 

    // Create a new custom field : phone_number 
    $custom_fields[] = array( 
        'name' => 'phone_number',
        'label' => 'Phone Number',
        'type' => 'text',
        'required' => true 
    ); 

    // Create a new custom field : Website Details 
    $custom_fields[] = array( 
        'name' => 'website_details',
        'label' => 'Website Details',
        'type' => 'text',
        'required' => true 
    ); 

    // Create a new custom field : Education 
    $custom_fields[] = array( 
        'name' => 'education', 
        'label' => 'Education', 
        'type' => 'text', 
        'required' => true 
    ); 
    return $custom_fields; 
} 
add_filter( 'learndash_registration_custom_fields', 'my_ld_custom_fields' );

 

 

What’s your Biggest LearnDash Challenge Right Now?

Let’s Talk