Last active
July 12, 2018 17:46
-
-
Save dparker1005/2ab9a5f552bd4eeb1c383b190d604717 to your computer and use it in GitHub Desktop.
Add Facebook Email Field on Checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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