-
-
Save travislima/148908d329d9e31f7ba8f431538b5b71 to your computer and use it in GitHub Desktop.
Register Helper Field Example - Incomplete Code
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 of Register Helper fields. Code is incomplete. For complete coding solution, please see: https://www.paidmembershipspro.com/documentation/register-helper-documentation/code-examples/ | |
* | |
*/ | |
// Define the fields. | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
'company', // input name, will also be used as meta key | |
'text', // type of field | |
array( | |
'label' => 'Company', // custom field label | |
'size' => 40, // input size | |
'class' => 'company', // custom class | |
'profile' => true, // show in user profile | |
'required' => true, // make this field required | |
'levels' => array(1,2) // only levels 1 and 2 should have the company field | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
'referral', // input name, will also be used as meta key | |
'text', // type of field | |
array( | |
'label' => 'Referral Code', // custom field label | |
'profile' => 'only_admin' // only show in profile for admins | |
) | |
); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment