Example #1
1
function ps_registration_fields()
{
    // store fields in an array
    $fields = array();
    // fields for all users
    $fields[] = new PMProRH_Field('gender', 'select', array('options' => array('' => 'Choose One', 'male' => 'Male', 'female' => 'Female'), 'profile' => true, 'required' => true));
    $fields[] = new PMProRH_Field('age', 'text', array('size' => 10, 'profile' => true, 'required' => true));
    $fields[] = new PMProRH_Field('phone', 'text', array('size' => 20, 'label' => 'Phone Number', 'profile' => true, 'required' => true));
    // fields for teachers
    $fields[] = new PMProRH_Field('department', 'text', array('size' => 40, 'profile' => true, 'required' => true));
    $fields[] = new PMProRH_Field('office', 'text', array('size' => 40, 'profile' => true, 'required' => true));
    // fields for students
    $fields[] = new PMProRH_Field('graduation_year', 'text', array('label' => 'Expected Graduation year', 'size' => 10, 'profile' => true, 'required' => true));
    $fields[] = new PMProRH_Field('major', 'text', array('size' => 40, 'profile' => true, 'required' => true));
    $fields[] = new PMProRH_Field('minor', 'text', array('size' => 40, 'profile' => true));
    // add fields to the registration page
    foreach ($fields as $field) {
        pmprorh_add_registration_field('after_password', $field);
    }
}
Example #2
1
function my_pmprorh_init()
{
    //don't break if Register Helper is not loaded
    if (!function_exists("pmprorh_add_registration_field")) {
        return false;
    }
    //define the fields
    $fields = array();
    $fields[] = new PMProRH_Field("occupation", "select", array("profile" => true, "options" => array("" => "Please select", "Avionic Technician" => "Avionic Technician", "Electronic Technician" => "Electronic Technician", "A&P Mechanic" => "A&P Mechanic", "Instructor" => "Instructor", "Student" => "Student", "Other" => "Other")));
    //add the fields into a new checkout_boxes are of the checkout page
    foreach ($fields as $field) {
        pmprorh_add_registration_field("after_email", $field);
    }
}
function pmpro_cpt_init()
{
    if (is_admin()) {
        add_action('admin_menu', 'my_page_meta_wrapper');
    }
    //-> add aditional field to checkout from
    //don't break if Register Helper is not loaded
    if (!function_exists("pmprorh_add_registration_field")) {
        return false;
    }
    //define the fields
    $fields = array();
    //radio
    $fields[] = new PMProRH_Field("type_suscription", "radio", array("options" => array("parent" => "I am a Parent", "student" => "I am a Student"), "class" => "suscription_field", "label" => "Are you a Parent or Student? *", "profile" => true, "required" => true));
    $fields[] = new PMProRH_Field("students_year", "text", array("size" => 40, "label" => "Student's year of high school graduation *", "class" => "students_year", "profile" => true, "required" => true, "showrequired" => true, "showmainlabel" => true));
    //add the fields into a new checkout_boxes are of the checkout page
    foreach ($fields as $field) {
        pmprorh_add_registration_field("after_captcha", $field);
    }
    //that's it. see the PMPro Register Helper readme for more information and examples.
}
Example #4
0
<?php

$text = new PMProRH_Field('company', 'text', array('size' => 40, 'class' => 'company', 'profile' => true, 'required' => true));
pmprorh_add_registration_field('after_billing_fields', $text);
Example #5
-2
 /**
  * 
  */
 private function addFieldsToRegistration()
 {
     $moreFields = array(array("field" => "address", "label" => "Address", "class" => "input", "type" => "text", "g-places-autocomplete" => null, "ng-model" => "address1", "profile" => false), array("field" => "address2", "label" => " ", "class" => "input", "type" => "text", "ng-model" => "address2", "profile" => false), array("field" => "address3", "label" => " ", "class" => "input", "type" => "text", "profile" => false), array("field" => "city", "label" => "City", "class" => "input", "type" => "text", "ng-model" => "city", "profile" => false), array("field" => "state", "label" => "State", "class" => "input", "type" => "text", "ng-model" => "state", "profile" => false), array("field" => "zip", "label" => "Zip Code", "class" => "input", "type" => "text", "ng-model" => "zip", "size" => 6, "profile" => false), array("field" => "telephone", "label" => "Telephone", "class" => "input", "type" => "text", "profile" => false), array("field" => "referred", "label" => "Referred By", "class" => "input", "type" => "text", "profile" => false), array("field" => "company_name", "label" => "Company Name", "class" => "input", "type" => "text", "profile" => false), array("field" => "company_website", "label" => "Company Website", "class" => "input", "type" => "text", "profile" => false), array("field" => "company_description", "label" => "Description of Company", "class" => "input", "type" => "textarea", "profile" => false));
     foreach ($moreFields as $field) {
         $text = new \PMProRH_Field($field["field"], $field["type"], $field);
         pmprorh_add_registration_field("after_email", $text);
     }
 }