Skip to content

Instantly share code, notes, and snippets.

@femiyb
Last active March 19, 2019 08:35
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 femiyb/1e22bd387e2109de94938e7dff3d27eb to your computer and use it in GitHub Desktop.
Save femiyb/1e22bd387e2109de94938e7dff3d27eb to your computer and use it in GitHub Desktop.
<?php
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(
'horseriding_type', //
'text', // type of field
array(
'label' => 'TYPE of HORSERIDING DISCIPLINE:', // custom field label
'required' => true, // make this field required
'profile' => true, // show in user profile
'memberslistcsv' => true, // Uncomment to Include in Member List CSV Export
// 'addmember' => true, // Uncomment to display in Add Member
)
);
$fields[] = new PMProRH_Field(
'horse_breed', //
'text', // type of field
array(
'label' => 'BREED OF HORSE:', // custom field label
'required' => true, // make this field required
'profile' => true, // show in user profile
'memberslistcsv' => true, // Uncomment to Include in Member List CSV Export
// 'addmember' => true, // Uncomment to display in Add Member
)
);
$fields[] = new PMProRH_Field(
'hoese_size', //
'text', // type of field
array(
'label' => 'SIZE OF HORSE:', // custom field label
'required' => true, // make this field required
'profile' => true, // show in user profile
'memberslistcsv' => true, // Uncomment to Include in Member List CSV Export
// 'addmember' => true, // Uncomment to display in Add Member
)
);
$fields[] = new PMProRH_Field(
'hoese_color', //
'text', // type of field
array(
'label' => 'PREFERRED COLORS FOR YOUR HORSE:', // custom field label
'required' => true, // make this field required
'profile' => true, // show in user profile
'memberslistcsv' => true, // Uncomment to Include in Member List CSV Export
// 'addmember' => true, // Uncomment to display in Add Member
)
);
$fields[] = new PMProRH_Field(
'your_color', //
'text', // type of field
array(
'label' => 'PREFERRED COLORS FOR YOURSELF:', // custom field label
'required' => true, // make this field required
'profile' => true, // show in user profile
'memberslistcsv' => true, // Uncomment to Include in Member List CSV Export
// 'addmember' => true, // Uncomment to display in Add Member
)
);
//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