Skip to content

Instantly share code, notes, and snippets.

@travislima
Forked from ideadude/my_pmprorh_init.php
Last active February 6, 2020 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travislima/148908d329d9e31f7ba8f431538b5b71 to your computer and use it in GitHub Desktop.
Save travislima/148908d329d9e31f7ba8f431538b5b71 to your computer and use it in GitHub Desktop.
Register Helper Field Example - Incomplete Code
<?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