Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom Fields (Register Helper)
<?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 <thomas@eighty20results.com>
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
You can’t perform that action at this time.