Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created February 27, 2018 19:21
Show Gist options
  • Save kimcoleman/c414bf7f6f9d741e9fd89981121e6cf5 to your computer and use it in GitHub Desktop.
Save kimcoleman/c414bf7f6f9d741e9fd89981121e6cf5 to your computer and use it in GitHub Desktop.
Register Helper custom fields for irishhealer.
<?php
/**
* Register Helper custom fields for irishhealer.
*/
function irishhealer_pmprorh_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
$indemnity_consent_content = get_post_field( 'post_content', 743 );
// Define the fields.
$fields = array();
$fields[] = new PMProRH_Field( 'junior_first_name', 'text', array( 'label' => 'First Name (Junior)', 'levels' => array( '2' ), 'profile' => true, 'required' => true ) );
$fields[] = new PMProRH_Field( 'junior_first_name', 'text', array( 'label' => 'Last Name (Junior)', 'levels' => array( '2' ), 'profile' => true, 'required' => true ) );
$fields[] = new PMProRH_Field( 'indemnity_consent_textarea', 'html', array( 'name' => '<textarea>' . $indemnity_consent_content . '</textarea>' ) );
$fields[] = new PMProRH_Field( 'indemnity_consent', 'checkbox', array( 'label' => 'I agree to the Indemnity Statement.', 'levels' => array( '2' ), 'profile' => true, 'required' => true ) );
$fields[] = new PMProRH_Field( 'signed_medical_declaration', 'file', array( 'label' => ' Upload your signed Medical Declaration.', 'profile' => true, 'required' => true ) );
pmprorh_add_checkout_box( 'information', 'Additional Information' );
foreach ( $fields as $field ) {
pmprorh_add_registration_field( 'information', $field );
}
}
add_action( 'init', 'irishhealer_pmprorh_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment