Last active
July 9, 2019 09:40
-
-
Save femiyb/855b5c5da269b93a6b066c86452e0032 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() { | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
'membership_overdue', | |
'select', | |
array( | |
'label' => 'Application Type:', | |
'required' => true, | |
'options' => array( | |
'' => '', | |
'new_member' => 'New Member', | |
'membership_renewal' => 'Membership Renewal', | |
'donation' => 'Donation', | |
) | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
"USPC_Bylaws:", | |
"checkbox", | |
array( | |
"label" => "USPC Bylaws: I have read and agree with the principles and rules outlined in the U.S. Pleace Council Bylaws.", | |
"profile" => true, | |
"required" => true, | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
"phone", | |
"text", | |
array( | |
"label" => "Phone:", | |
"profile" => true, | |
"required" => true, | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
"city_state", | |
"text", | |
array( | |
"label" => "City, State:", | |
"profile" => true, | |
"required" => true, | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
"chapter", | |
"text", | |
array( | |
"label" => "Chapter:", | |
"profile" => true, | |
"required" => true, | |
) | |
); | |
//add the fields into a new checkout_boxes are of the checkout page | |
foreach($fields as $field) | |
pmprorh_add_registration_field( | |
'checkout_boxes', // location on checkout page | |
$field // PMProRH_Field object | |
); | |
//that's it. see the PMPro Register Helper readme for more information and examples. | |
} | |
add_action( 'init', 'my_pmprorh_init' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment