How to add new fields in Registration form

Note: Paste this code into your functions.php of your active theme

Personal Information

function wpcfe_personal_info_fields_callback( $personal_fields ){
	$personal_fields['new_text'] = array(
		'id'			=> 'nickname',
        'label'			=> 'Nick Name',
        'field'			=> 'text',
        'field_type'	=> 'text',
        'required'		=> false,
        'options'		=> array(),
		'field_data'	=> array(),
		'field_key'		=> 'nickname'
	);
	$personal_fields['new_option'] = array(
		'id'			=> 'gender',
        'label'			=> 'Gender',
        'field'			=> 'select',
        'field_type'	=> 'select',
        'required'		=> false,
        'options'		=> array(
        	'Female',
        	'Male'
        ),
		'field_data'	=> array(),
		'field_key'		=> 'gender'
	);
	return $personal_fields;
}
add_filter( 'wpcfe_personal_info_fields', 'wpcfe_personal_info_fields_callback' );

Billing Information

add_filter( 'wpcfe_personal_info_fields', 'wpcfe_personal_info_fields_callback' );
function wpcfe_billing_address_fields_callback( $billing_fields ){
	$billing_fields['new_text'] = array(
		'id'			=> 'currency',
        'label'			=> 'Currency',
        'field'			=> 'text',
        'field_type'	=> 'text',
        'required'		=> false,
        'options'		=> array(),
		'field_data'	=> array(),
		'field_key'		=> 'currency'
	);
	$billing_fields['new_option'] = array(
		'id'			=> 'payment_method',
        'label'			=> 'Payment Method',
        'field'			=> 'select',
        'field_type'	=> 'select',
        'required'		=> false,
        'options'		=> array(
        	'Cash on Delivery',
        	'Credit card',
        	'Option 3'
        ),
		'field_data'	=> array(),
		'field_key'		=> 'payment_method'
	);
	return $billing_fields;
}
add_filter( 'wpcfe_billing_address_fields', 'wpcfe_billing_address_fields_callback' );
0
    0
    Your Cart
    Your cart is emptyReturn to Shop