Created
February 7, 2018 14:10
-
-
Save kimcoleman/eecde9ea7d65e7d4187e022f769cc235 to your computer and use it in GitHub Desktop.
Register Helper field for a select2 element for Interests for thread by maxk97
This file contains hidden or 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 | |
function my_pmprorh_after_email_init() { | |
//don't break if Register Helper is not loaded | |
if( !function_exists( 'pmprorh_add_registration_field') ) { | |
return false; | |
} | |
//define the fields | |
$fields_after_email = array(); | |
$fields_after_email[] = new PMProRH_Field( | |
'inter', | |
'select2', | |
array( | |
'label' => 'Interests', | |
'profile' => true, | |
'required' => false, | |
'memberslistcsv' => true, | |
'options' => | |
array( | |
'' => '', | |
'athletics' => 'Athletics', | |
'basketball' => 'Basketball', | |
'boxing' => 'Boxing', | |
'climbing' => 'Climbing', | |
'cricket' => 'Cricket', | |
'cycling' => 'Cycling', | |
'gym' => 'GYM', | |
'football' => 'Football', | |
'golf' => 'Golf', | |
'hockey' => 'Hockey', | |
'motocross' => 'Motocross', | |
'rugby' => 'Rugby', | |
'running' => 'Running', | |
'skate' => 'Skate', | |
'swimming' => 'Swimming', | |
'tennis' => 'Tennis', | |
'watersports' => 'Water Sports', | |
'wintersports' => 'Winter Sports', | |
), | |
) | |
); | |
//add the fields in the after_email area of the checkout page | |
foreach( $fields_after_email as $field ) { | |
pmprorh_add_registration_field("after_email", $field); | |
} | |
} | |
add_action( 'init', 'my_pmprorh_after_email_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment