JoeHana
1/27/2014 - 3:27 AM

wpCasa: Custom Contact Form

wpCasa: Custom Contact Form

<?php

/**
 * Custom Contact Form
 */
add_filter('wpsight_contact_fields', 'wps41_contact_fields', 100);

function wps41_contact_fields($contact_fields) {
	
	$contact_labels = wpsight_contact_labels();
	
	// Extract labels
	extract( $contact_labels, EXTR_SKIP );
	
	// Set contact fields
	
	$contact_fields = array(
		
		'fields_1' => array(
			'id' 		  	 => 'contact_name',
			'label'		  	 => $name,
			'label_email'  	 => $name_email,
			'required'	  	 => true,
			'type'		  	 => 'text',
			'placeholder' 	 => true,
			'before'		 => false,
			'after'			 => false,
			'value'			 => false,
			'position'	  	 => 10
		),
		'fields_2' => array(
			'id' 		  	 => 'contact_email',
			'label'		  	 => $email,
			'label_email'  	 => $email_email,
			'required'	  	 => 'email',
			'type'		  	 => 'text',
			'placeholder' 	 => true,
			'before'		 => false,
			'after'			 => false,
			'value'			 => false,
			'position'	  	 => 20
		),
		'fields_3' => array(
			'id' 		  	 => 'contact_phone',
			'label'		  	 => $phone,
			'label_email'  	 => $phone_email,
			'required'	  	 => false,
			'type'		  	 => 'numbers',
			'placeholder' 	 => true,
			'before'		 => false,
			'after'			 => false,
			'value'			 => false,
			'position'	  	 => 30
		),
		'fields_4' => array(
			'id' 		  	 => 'contact_message',
			'label'		  	 => $message,
			'label_email' 	 => $message_email,
			'required'	  	 => true,
			'type'		  	 => 'textarea',
			'placeholder' 	 => true,
			'before'		 => false,
			'after'			 => false,
			'value'			 => false,
			'position'	  	 => 40
		),
		'captcha' => array(
			'show' 		  	 => true,
			'type'			 => 'string', // can be 'math'
			'placeholder' 	 => false,
			'case_sensitive' => false,
			'code_length'	 => 4,
			'image_width' 	 => 150,
			'image_height'	 => 60,
			'perturbation' 	 => .5,
			'bg_color' 		 => '#ffffff',
			'text_color' 	 => '#606060',
			'num_lines' 	 => 6,
			'line_color' 	 => '#6e6e6e',
			'font'		  	 => './AHGBold.ttf',
			'before'		 => false,
			'after'			 => false,
			'value'			 => false,
			'position'		 => false // will be placed at the end
		),
		'copy'	  => array(
			'show' 			 => true,
			'placeholder' 	 => false,
			'position'		 => false // will be placed at the end
		),
		'custom_checkbox'	  => array(
			'show' 			 => true,
			'label'		  	 => 'Custom Text',
			'label_email' 	 => 'Custom Text',
			'type'           => 'checkbox',
 	        'placeholder'    => true,
 	        'before'         => false,
  	        'after'          => false,
    	    'value'          => false,
  	        'data'           => array(
            	'value1' => 'Value #1',
            	'value2' => 'Value #2',
            	'value3' => 'Value #3'
        	),
			'position'		 => 25 // will be placed at the end
		)
		
	);
	
	return $contact_fields;
	
}