Last active
November 25, 2020 15:48
-
-
Save plugin-republic/323aa58ed52102e896fcaafae79d4579 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add custom field to registration form | |
*/ | |
function my_prefix_registration_fields( $fields ) { | |
// Add a text field | |
$fields['new_field'] = array( | |
'label' => __( 'New Field', 'wcmo' ), | |
'type' => 'text', | |
'priority' => 250, | |
'add_to_profile' => true // Select this if you wish to display this field in user profiles | |
); | |
// Add a select field | |
$fields['new_select_field'] = array( | |
'label' => __( 'New Select Field', 'wcmo' ), | |
'type' => 'select', | |
'priority' => 300, | |
'options' => array( | |
'option-1' => 'Option 1', | |
'option-2' => 'Option 2' | |
), | |
'add_to_profile' => true // Select this if you wish to display this field in user profiles | |
); | |
return $fields; | |
} | |
add_filter( 'wcmo_registration_fields', 'my_prefix_registration_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment