Created
February 9, 2022 21:35
-
-
Save kerijacoby/d689b93edc65d583cee2db4f5675c866 to your computer and use it in GitHub Desktop.
PMPro Register Helper Add Text Field
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 Additional Register Helper field for: Stage/ Zoom Name | |
* Save All To User Profile Page | |
* Applies To All Levels | |
*/ | |
// We have to put everything in a function called on init, so we are sure Register Helper is loaded. | |
function pmpro_register_helper_add_fields() { | |
// Don't break if Register Helper is not loaded. | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return false; | |
} | |
// Define the default fields array. | |
$fields = array(); | |
// Stage or Zoom name. | |
$fields[] = new PMProRH_Field( | |
'user', | |
'text', | |
array( | |
'label' => 'Stage/Zoom Name', | |
'hint' => 'Please enter the name you would like to be called for performances and/or Zoom sessions.', | |
'class' => 'user', | |
'profile' => true, | |
'required' => true, | |
) | |
); | |
foreach ( $fields as $field ) { | |
pmprorh_add_registration_field( | |
'checkout_boxes', | |
$field | |
); | |
} | |
// That's it. See the PMPro Register Helper readme for more information and examples. | |
} | |
add_action( 'init', 'pmpro_register_helper_add_fields' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment