Example #1
0
<?php

PLS_Lead_Capture::init();
class PLS_Lead_Capture
{
    public static function init()
    {
        add_action('wp_ajax_pls_update_client_profile', array(__CLASS__, 'update'));
    }
    public static function update()
    {
        $person_details = $_POST;
        $result = PLS_Plugin_API::update_person_details($person_details);
        echo json_encode($result);
        die;
    }
    public static function get_contact_form()
    {
        // Get args passed to shortcode
        $form_args = func_get_args();
        extract($form_args[0], EXTR_SKIP);
        $title_text = pls_get_option('pd-lc-form-title');
        $description = pls_get_option('pd-lc-form-description');
        // Default
        ob_start();
        ?>
            <div class="lead-capture-wrapper" style="width: <?php 
        echo $width;
        ?>
px !important; height:<?php 
        echo $height;
Example #2
0
 private function build_lead_capture_form($args)
 {
     $defaults = array('width' => '', 'height' => '', 'title_visible' => true, 'title_text' => '', 'title' => '', 'success_message' => '', 'cc_value' => '', 'bcc_value' => '', 'name_placeholder' => 'Full Name', 'name_required' => true, 'name_error' => 'Your name is required.', 'email_placeholder' => 'Email Address', 'email_required' => true, 'email_error' => 'A valid email is required.', 'phone_include' => true, 'phone_placeholder' => 'Phone Number', 'phone_required' => "false", 'phone_error' => 'Your phone number is required.', 'subject_placeholder' => 'Subject', 'subject_required' => "false", 'subject_error' => 'Please add a subject.', 'question_placeholder' => 'Comments', 'question_required' => true, 'question_error' => "Don't forget to leave a question or comment.", 'button_text' => 'Submit', 'description_visible' => true, 'back_on_lc_cancel' => '');
     $args = wp_parse_args($args, $defaults);
     return PLS_Lead_Capture::get_contact_form($args);
 }
Example #3
0
function lead_capture_shortcode($args)
{
    $args_with_overrides = shortcode_atts(array('width' => '', 'height' => '', 'title_visible' => true, 'title_text' => '', 'title' => '', 'success_message' => '', 'cc_value' => '', 'bcc_value' => '', 'name_placeholder' => 'Full Name', 'name_required' => true, 'name_error' => 'Your name is required.', 'email_placeholder' => 'Email Address', 'email_required' => true, 'email_error' => 'A valid email is required.', 'phone_include' => true, 'phone_placeholder' => 'Phone Number', 'phone_required' => "false", 'phone_error' => 'Your phone number is required.', 'subject_placeholder' => 'Subject', 'subject_required' => "false", 'subject_error' => 'Please add a subject.', 'question_placeholder' => 'Comments', 'question_required' => true, 'question_error' => "Don't forget to leave a question or comment.", 'button_text' => 'Submit', 'description_visible' => true, 'back_on_lc_cancel' => ''), $args);
    echo PLS_Lead_Capture::get_contact_form($args_with_overrides);
}