AnsPress_Form::__construct( array $args = array() )

Description #

Initiate the class.

Parameters #

  • $args
    array (Optional) Form arguments. Default value: array()

Source #

File: includes/class/form.php

	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();
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment