Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created February 7, 2018 19:43
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 kimcoleman/732000e156ac4e82a3b0aba0d30ae904 to your computer and use it in GitHub Desktop.
Save kimcoleman/732000e156ac4e82a3b0aba0d30ae904 to your computer and use it in GitHub Desktop.
Register Helper checkbox field for thread by igbc
<?php
function my_pmprorh_after_email_init_igbc() {
//don't break if Register Helper is not loaded
if( !function_exists( 'pmprorh_add_registration_field') ) {
return false;
}
//define the fields
$fields_after_email = array();
$fields_after_email[] = new PMProRH_Field(
'igbc_mailings',
'checkbox',
array(
'label' => 'Check this box to receive IGBC communications by email',
'profile' => true,
'required' => false,
'memberslistcsv' => true,
)
);
//add the fields in the after_email area of the checkout page
foreach( $fields_after_email as $field ) {
pmprorh_add_registration_field("after_email", $field);
}
}
add_action( 'init', 'my_pmprorh_after_email_init_igbc' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment