array(), 'placeholder' => esc_html__( 'Select an item', 'brunch-lite' ), ) ); $field = parent::normalize( $field ); $field['js_options'] = wp_parse_args( $field['js_options'], array( 'allowClear' => true, 'width' => 'none', 'placeholder' => $field['placeholder'], ) ); return $field; } /** * Get the attributes for a field * * @param array $field * @param mixed $value * @return array */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); $attributes = wp_parse_args( $attributes, array( 'data-options' => wp_json_encode( $field['js_options'] ), ) ); return $attributes; } }