AnsPress_Form::add_default_in_field()
Description #
Add fields default values.
Source #
File: includes/class/form.php
private function add_default_in_field() { if ( ! isset( $this->args['fields'] ) ) { return; } foreach ( (array) $this->args['fields'] as $k => $field ) { if ( ! is_array( $field ) ) { return; } $this->args['fields'][ $k ] = wp_parse_args( $field, array( 'order' => 10, 'show_desc_tip' => false, 'type' => 'text', ) ); // Get value from opttions if options_form. if ( 'options_form' == $this->name && isset( $field['name'] ) && ! isset( $field['value'] ) ) { $this->args['fields'][ $k ]['value'] = ap_opt( $field['name'] ); } } }
Expand full source code Collapse full source code View on GitHub: includes/class/form.php:87
Add your comment