Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active February 18, 2020 13:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save strangerstudios/758cc828e8c2b1f5cb3864bde3957536 to your computer and use it in GitHub Desktop.
Save strangerstudios/758cc828e8c2b1f5cb3864bde3957536 to your computer and use it in GitHub Desktop.
Capture default user profile fields at Membership Checkout using Register Helper
/*
Add Website and Biographical Info to Membership Checkout
*/
function my_default_wp_user_checkout_fields()
{
if(class_exists("PMProRH_Field"))
{
pmprorh_add_checkout_box("additional", "Additional Information");
$fields = array();
//user_url field
$fields[] = new PMProRH_Field(
"url",
"text",
array(
"label"=>"Website",
"size"=>40,
"profile"=>true,
"required"=>false,
)
);
//user_description field
$fields[] = new PMProRH_Field(
"description",
"textarea",
array(
"label"=>"Biographical Info",
"size"=>40,
"profile"=>true,
"required"=>false,
)
);
foreach($fields as $field)
pmprorh_add_registration_field("additional", $field);
}
}
add_action("init", "my_default_wp_user_checkout_fields");
@ipokkel
Copy link

ipokkel commented Feb 4, 2020

For a version that submits the url to wp_user table at checkout:
https://gist.github.com/ipokkel/2f88849447f85175eb161b19d4551119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment