Form::after_save( boolean|array $fields = false, array $args = array() )

Description #

Run all after save methods in fields and child fields.

Parameters #

  • $fields
    boolean | array (Optional) Fields. Default value: false
  • $args
    array (Optional) Arguments to be passed to method. Default value: array()

Changelog #

VersionDescription
4.1.5Delete AnsPress session data.
4.1.0Introduced.

Source #

File: lib/class-form.php

	public function after_save( $fields = false, $args = array() ) {
		// Delete session data.
		$this->delete_values_session();

		if ( false === $this->prepared ) {
			$this->prepare();
		}

		if ( false === $fields ) {
			$fields = $this->fields;
		}

		foreach ( (array) $fields as $field ) {
			$field->after_save( $args );

			if ( ! empty( $field->child ) && ! empty( $field->child->fields ) ) {
				$this->after_save( $field->child->fields, $args );
			}
		}
	}

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