diff --git a/dt-core/utilities/dt-components.php b/dt-core/utilities/dt-components.php index 0466cef842..042074c0c8 100644 --- a/dt-core/utilities/dt-components.php +++ b/dt-core/utilities/dt-components.php @@ -259,10 +259,25 @@ public static function render_tags( $field_key, $fields, $post, $params = [] ) { $value = array_map(function ( $value ) { return $value; }, $post[$field_key] ?? []); + + $options = null; + if ( isset( $params['static_options'] ) && $params['static_options'] ) { + $raw_options = DT_Posts::get_multi_select_options( $post['post_type'] ?? 'contacts', $field_key ); + if ( is_array( $raw_options ) ) { + foreach ( $raw_options as $option ) { + if ( is_string( $option ) ) { + $options[] = [ 'id' => $option ]; + } elseif ( is_array( $option ) && isset( $option['label'] ) ) { + $options[] = [ 'id' => $option['label'] ]; + } + } + } + } ?> value='' placeholder="" + allowAdd>