AnsPress_Form::__construct( array $args = array() )
Description #
Initiate the class.
Parameters #
- $argsarray (Optional) Form arguments. Default value: array()
Source #
File: includes/class/form.php
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | public function __construct( $args = array () ) { // Default form arguments. $defaults = array ( 'method' => 'POST' , 'action' => '' , 'is_ajaxified' => false, 'class' => 'ap-form' , 'multipart' => false, 'submit_button' => __( 'Submit' , 'anspress-question-answer' ), ); // Merge defaults args. $this ->args = wp_parse_args( $args , $defaults ); // Set the name of the form. $this ->name = $this ->args[ 'name' ]; global $ap_errors ; $this ->errors = $ap_errors ; $this ->add_default_in_field(); $this ->order_fields(); } |
Expand full source code Collapse full source code View on GitHub: includes/class/form.php:58
Add your comment