/** * search widget form fields defaults * @since 2.2 */ function epl_search_get_defaults() { $defaults = array(); $fields = epl_search_widget_fields(); foreach ($fields as $field) { $defaults[$field['key']] = $field['default']; } return $defaults; }
function form($instance) { $defaults = epl_search_get_defaults(); $instance = wp_parse_args((array) $instance, $defaults); $instance = array_map('epl_esc_attr', $instance); extract($instance); $post_types = $post_type; $fields = epl_search_widget_fields(); foreach ($fields as $field) { $field_value = ${$field['key']}; epl_widget_render_backend_field($field, $this, $field_value); } }