Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Last active July 12, 2018 17:46
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 dparker1005/2ab9a5f552bd4eeb1c383b190d604717 to your computer and use it in GitHub Desktop.
Save dparker1005/2ab9a5f552bd4eeb1c383b190d604717 to your computer and use it in GitHub Desktop.
Add Facebook Email Field on Checkout
<?php
//Add from here down to the bottom of your PMProcustomizations 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 field.
$facebook_email = new PMProRH_Field(
'facebook_email', // input name, will also be used as meta key.
'text', // type of field.
array(
'label' => 'Which email address do you use for your Facebook Account', // custom field label.
'size' => 40, // input size.
'profile' => true, // show in user profile.
'required' => false, // make this field required.
)
);
pmprorh_add_registration_field(
'after_email', // location on checkout page.
$facebook_email // PMProRH_Field object.
);
}
add_action( 'init', 'my_pmprorh_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment