Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions inc/managers/class-dns-record-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,11 @@ public function add_dns_settings(): void {
'desc' => __('Select which DNS record types customers can manage.', 'ultimate-multisite'),
'type' => 'multiselect',
'options' => [
'A' => __('A (IPv4 Address)', 'ultimate-multisite'),
'AAAA' => __('AAAA (IPv6 Address)', 'ultimate-multisite'),
'CNAME' => __('CNAME (Alias)', 'ultimate-multisite'),
'MX' => __('MX (Mail Exchange)', 'ultimate-multisite'),
'TXT' => __('TXT (Text Record)', 'ultimate-multisite'),
'A' => ['title' => __('A (IPv4 Address)', 'ultimate-multisite')],
'AAAA' => ['title' => __('AAAA (IPv6 Address)', 'ultimate-multisite')],
'CNAME' => ['title' => __('CNAME (Alias)', 'ultimate-multisite')],
'MX' => ['title' => __('MX (Mail Exchange)', 'ultimate-multisite')],
'TXT' => ['title' => __('TXT (Text Record)', 'ultimate-multisite')],
],
'default' => ['A', 'CNAME', 'TXT'],
'require' => [
Expand Down
12 changes: 9 additions & 3 deletions views/admin-pages/fields/field-multiselect.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"

<?php foreach ($field->options as $value => $option) : ?>

<?php
// Support both string options ('key' => 'Label') and array options ('key' => ['title' => 'Label', 'desc' => '...'])
$option_title = is_array($option) ? ($option['title'] ?? '') : (string) $option;
$option_desc = is_array($option) ? ($option['desc'] ?? '') : '';
?>

<li class="item wu-box-border wu-m-0 wu-my-2">

<div class="wu-bg-gray-100 wu-p-3 wu-m-0 wu-border-gray-300 wu-border-solid wu-border wu-rounded wu-items-center wu-flex wu-justify-between">
Expand All @@ -54,15 +60,15 @@ class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>"

<span class="wu-my-1 wu-text-xs wu-font-bold wu-block">

<?php echo esc_html($option['title']); ?>
<?php echo esc_html($option_title); ?>

</span>

<?php if (isset($option['desc']) && ! empty($option['desc'])) : ?>
<?php if ( ! empty($option_desc)) : ?>

<span class="wu-my-1 wu-inline-block wu-text-xs">

<?php echo esc_html($option['desc']); ?>
<?php echo esc_html($option_desc); ?>

</span>

Expand Down
Loading