Plugin Directory

Changeset 2661818


Ignore:
Timestamp:
01/22/2022 06:08:13 PM (4 years ago)
Author:
wprequal
Message:

Commit v7.10.2

Location:
wprequal/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wprequal/trunk/includes/classes/class.ContactForm.php

    r2654876 r2661818  
    147147                        'key'           => '',
    148148                        'placeholder'   => '',
    149                         'required'      => '',
     149                        'required'      => FALSE,
    150150                        'value'         => '',
    151151                        'default_value' => '',
     
    156156
    157157                    foreach ( $inputs as $input => $values ) {
    158 
    159                         foreach ( $defaults as $key => $default_value ) {
    160                             $inputs[ $input ][ $key ] = empty( $inputs[ $input ][ $key ] ) ? $default_value : $inputs[ $input ][ $key ];
    161                         }
    162 
     158                        $inputs[ $input ] = wp_parse_args( $values, $defaults );
    163159                    }
    164160
     
    177173                'label'      => 'Full Name',
    178174                'type_label' => 'Full Name',
    179                 'required'   => 'checked',
     175                'required'   => FALSE,
    180176                'labels'     => array(
    181177                    'fname' => 'First',
     
    197193                'label'       => 'Phone',
    198194                'type_label'  => 'Phone',
    199                 'required'    => 'checked',
     195                'required'    => FALSE,
    200196                'placeholder' => ''
    201197            )
     
    253249    public function form( $args ) {
    254250
    255         $view    = ( $args['type'] === 'contact' ) ?  'contact-form' : 'contact-inputs';
    256 
    257         $args = wp_parse_args( $args, self::form_defaults() );
     251        $view = ( $args['type'] === 'contact' ) ?  'contact-form' : 'contact-inputs';
     252        $contact_form_id = intval( $args['contact_form_id'] );
    258253
    259254        view( 'contact/form', $view, [
    260             'inputs'          => $this->get_inputs( $args['contact_form_id'] ),
    261             'details'         => self::get_details( $args['contact_form_id'] ),
     255            'inputs'          => $this->get_inputs( $contact_form_id ),
     256            'details'         => self::get_details( $contact_form_id ),
    262257            'type'            => $args['type'],
    263258            'button_action'   => $args['button_action'],
    264             'contact_form_id' => $args['contact_form_id']
     259            'contact_form_id' => $contact_form_id
    265260        ] );
    266 
    267     }
    268 
    269     /**
    270      * Form Defaults
    271      *
    272      * @return array
    273      */
    274 
    275     public static function form_defaults() {
    276 
    277         return array(
    278             'contact_form_id' => 0,
    279             'type'            => 'survey',
    280             'button_action'   => 'submit-button'
    281         );
    282261
    283262    }
  • wprequal/trunk/includes/classes/class.SurveyForm.php

    r2659649 r2661818  
    160160    public function contact_form( $slide ) {
    161161
    162         $args = wp_parse_args( $slide, ContactForm::form_defaults() );
    163         $args['type'] = 'survey';
     162        $slide['type'] = 'survey';
    164163
    165164        ob_start();
    166         do_action( 'wprequal_contact_form', $args );
     165        do_action( 'wprequal_contact_form', $slide );
    167166        return ob_get_clean();
    168167
  • wprequal/trunk/readme.txt

    r2659649 r2661818  
    164164== Change Log ==
    165165
     166= 7.10.2 =
     167Bug Fix - Set contact form ID an int
     168
    166169= 7.10.1 =
    167170Bug Fix - Set contact form type for survey
  • wprequal/trunk/wprequal.php

    r2659649 r2661818  
    44Plugin URI:  https://wprequal.com
    55Description: Mortgage and Real Estate Lead Capture System
    6 Version:     7.10.1
     6Version:     7.10.2
    77Author:      WPrequal
    88Author URI:  https://wprequal.com
     
    4444
    4545$constants = array(
    46     'WPREQUAL_VERSION'            => '7.10.1',
     46    'WPREQUAL_VERSION'            => '7.10.2',
    4747    'WPREQOAL_PLUGIN'             => plugin_basename( __FILE__ ),
    4848    'WPREQUAL_OPTIONS'            => 'wprequal_options',
Note: See TracChangeset for help on using the changeset viewer.