Last active
February 6, 2020 10:55
-
-
Save travislima/8448052236949edd42f96925d0b2ee75 to your computer and use it in GitHub Desktop.
Example of Paid Memberships Pro - Register Helper Code. This code registers the Register Helper 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 | |
/* | |
* EXAMPLE ONLY of Paid Memberships Pro - Register Helper Code. | |
* Paste new Register Helper Fields above this line(s) of code in your PMPro Customizations Plugin | |
*/ | |
$fields = array(); // this line should not be added a second time if you have previously declared it which i believe you have if you are trying to use this code recipe | |
$fields[] = new PMProRH_Field( | |
'field_name', // input name, will also be used as meta key | |
'text', // type of field | |
array( | |
'label' => "Label", // label of your field to be displayed | |
'required' => true, // make this field required | |
'profile' => true, // show in user profile | |
)); | |
foreach ( $fields as $field ) { | |
pmprorh_add_registration_field( | |
'checkout_boxes', // location on checkout page | |
$field // PMProRH_Field object | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment