Created
May 23, 2017 23:03
-
-
Save eighty20results/f1901286b9aac5d772d4326268a32fa5 to your computer and use it in GitHub Desktop.
Custom Fields (Register Helper)
This file contains hidden or 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 | |
/* | |
Plugin Name: PMPro: Custom Registration/WordPress Profile Fields | |
Description: Custom fields, using the PMPro Register Helper add-on | |
Plugin URI: https://eighty20results.com/paid-memberships-pro/do-it-for-me/ | |
Author: Thomas Sjolshagen @ Paid Memberships Pro <[email protected]> | |
Author URI: https://eighty20results.com/thomas-sjolshagen/ | |
Version: 1.0 | |
License: GPL2 | |
Text Domain: sn-customizations | |
Domain Path: /languages | |
*/ | |
if ( ! function_exists( 'sn_rh_loader' ) ) { | |
function sn_rh_loader() { | |
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { | |
return; | |
} | |
$fields = array(); | |
$fields[] = new PMProRH_Field( | |
'bitcoin_address', | |
'text', | |
array( | |
'label' => __( 'Your Bitcoin Address for Referral Commission', 'sn-customizations' ), | |
"class" => "rh-field", // custom field label | |
"profile" => true, // show in user profile | |
"memberslistcsv" => true, // Include in Member List CSV Export | |
"required" => true, // make this field required | |
) | |
); | |
$fields[] = new PMProRH_Field( | |
'referred_by', | |
'text', | |
array( | |
'label' => __( 'Referred By', 'sn-customizations' ), | |
"class" => "rh-field", // custom field label | |
"profile" => true, // show in user profile | |
"memberslistcsv" => true, // Include in Member List CSV Export | |
"required" => true, // make this field required | |
) | |
); | |
foreach ( $fields as $field ) { | |
pmprorh_add_registration_field( | |
'checkout_boxes', | |
$field | |
); | |
} | |
} | |
add_action( 'init', 'sn_rh_loader', 10 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment