Form::set_values( array $values )
Description #
Set values for a field.
This must be called before initialization of form.
Parameters #
- $valuesarray (Required) Values.
Changelog #
Source #
File: lib/class-form.php
public function set_values( $values ) { if ( false === $this->prepared ) { $this->prepare(); } if ( empty( $values ) ) { return $this; } foreach ( $values as $key => $val ) { if ( is_array( $val ) && isset( $val['value'] ) ) { $val = $val['value']; } $field = $this->find( $key ); if ( $field ) { $field->value = $val; } } return $this; }
Expand full source code Collapse full source code View on GitHub: lib/class-form.php:555
Add your comment