Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created April 6, 2016 13:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/94d731b629c085efa84cb1f365c901d2 to your computer and use it in GitHub Desktop.
Save andrewlimaza/94d731b629c085efa84cb1f365c901d2 to your computer and use it in GitHub Desktop.
PMPRO Register Helper - 3 Custom fields
<?php
/*
Paste this code into active theme's functions.php or custom plugin.
*/
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
}
//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",
"size"=>30, // input size
"profile"=>true, // show in user profile
));
$fields[] = new PMProRH_Field(
"position", // input name, will also be used as meta key
"text", // type of field
array(
"label"=>"Position",
"size"=>30, // input size
"profile"=>true, // show in user profile
));
$fields[] = new PMProRH_Field(
"website", // input name, will also be used as meta key
"text", // type of field
array(
"label"=>"Website",
"size"=>30, // input size
"profile"=>true, // show in user profile
));
//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