Form::field_values( boolean|array $fields = false )
Description #
Get values from all fields.
Parameters #
- $fieldsboolean | array (Optional) Child fields. Default value: false
Source #
File: lib/class-form.php
private function field_values( $fields = false ) { $values = array(); if ( false === $this->prepared ) { $this->prepare(); } if ( false === $fields ) { $fields = $this->fields; } foreach ( (array) $fields as $field ) { $field->pre_get(); $values[ $field->original_name ] = array( 'value' => $field->value() ); if ( ! empty( $field->child ) && ! empty( $field->child->fields ) ) { $values[ $field->original_name ]['child'] = $this->field_values( $field->child->fields ); } } return $values; }
Expand full source code Collapse full source code View on GitHub: lib/class-form.php:476
Add your comment