feat(icons): wire the universal picker into tabbar/floating settings and keep customsvg through their save paths

手机底部Tab and 右侧悬浮按钮 settings pages swap their icon text inputs
for the shared FaIconPicker (with a new IconValue preview component that
renders FA/sprite/custom SVG values in lists and previews). footer.php
tabbar/floating/sub-item icons and the VIP float render through
aksrt_icon_markup so every stored format displays; GlobalControllerPart1
and the VIP helper drop the FA-only regex gate and sanitize icon values
through aksrt_sanitize_icon_value. The picker popover tabs now wrap
instead of overflowing, and FA grid previews use style-only classes.
This commit is contained in:
kate522 committed 2026-09-06 14:27:49 +08:00
1 parent d89752d543
commit 70cba11fb7
8 files changed
+96 -63

No files matched your search

+9 -11
View File
@@ -132,9 +132,7 @@ $_footer_conter = wp_kses_post(trim((string) $footer_customize_code));
$m_url = (string) ($more_item['link'] ?? '');
$m_text = (string) ($more_item['desc'] ?? '');
$m_icon = (string) ($more_item['icon'] ?? '');
$m_icon_html = ($m_icon !== '' && function_exists('aksrt_brand_icon'))
? aksrt_brand_icon($m_icon)
: '';
$m_icon_html = $m_icon !== '' ? aksrt_icon_markup($m_icon) : '';
if ($m_icon_html === '') {
$m_icon_html = '<i class="fa fas fa-heart" aria-hidden="true"></i>';
}
@@ -262,7 +260,7 @@ if ($floating_enabled) :
$item_class .= ' ontop';
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" id="float-back-to-top" role="button" aria-label="<?php echo esc_attr($item_text ?: __('返回顶部', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
</a>
<?php elseif ($item_type === 'theme_mode') :
$item_class .= ' theme-toggle-btn';
@@ -282,7 +280,7 @@ if ($floating_enabled) :
$wechat_img = $item['wechat_img'] ?? ($item['qrcode_img'] ?? '');
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('微信', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
<?php if ($wechat_img) : ?>
<div class="hover-show-con">
<img src="<?php echo esc_url($wechat_img); ?>" alt="<?php esc_attr_e('微信二维码', 'aksrt'); ?>">
@@ -296,7 +294,7 @@ if ($floating_enabled) :
$qq_img = $item['qrcode_img'] ?? '';
?>
<a href="<?php echo $qq_number ? esc_url('https://wpa.qq.com/msgrd?v=3&uin=' . $qq_number . '&site=qq&menu=yes') : '#'; ?>" class="<?php echo esc_attr($item_class); ?>" role="button"<?php echo $qq_number ? ' target="_blank" rel="noopener noreferrer"' : ''; ?> aria-label="<?php echo esc_attr($item_text ?: 'QQ'); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
<?php if ($qq_img || $qq_number) : ?>
<div class="hover-show-con">
<?php if ($qq_img) : ?>
@@ -311,7 +309,7 @@ if ($floating_enabled) :
$add_items = is_array($item['add_items'] ?? null) ? $item['add_items'] : [];
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('发布', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
<?php if (!empty($add_items)) : ?>
<div class="hover-show-con">
<div class="float-add-menu">
@@ -321,7 +319,7 @@ if ($floating_enabled) :
$sub_text = $sub['text'] ?? '';
?>
<a href="<?php echo esc_url($sub_url); ?>" class="float-add-menu__item">
<i class="<?php echo esc_attr($sub_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $sub_icon); // pre-escaped ?>
<span><?php echo esc_html($sub_text); ?></span>
</a>
<?php endforeach; ?>
@@ -333,7 +331,7 @@ if ($floating_enabled) :
$item_class .= ' qrcode-btn';
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('二维码', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
<div class="hover-show-con">
<div
class="qrcode float-btn-qrcode"
@@ -348,7 +346,7 @@ if ($floating_enabled) :
$hover_width = (int) ($item['hover_width'] ?? 200);
?>
<a href="<?php echo esc_url($item_url ?: '#'); ?>" class="<?php echo esc_attr($item_class); ?>"<?php echo $item_target; echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $item_icon); // pre-escaped ?>
<?php if ($hover_html !== '') : ?>
<div class="hover-show-con"<?php echo $hover_width !== 200 ? ' style="min-width:' . (int) $hover_width . 'px"' : ''; ?>>
<div class="float-right__html"><?php echo wp_kses_post($hover_html); ?></div>
@@ -390,7 +388,7 @@ if ($floating_enabled) :
}
?>
<a href="<?php echo esc_url($tab_href); ?>" class="tabbar-item" data-type="<?php echo esc_attr($tab_type); ?>">
<i class="<?php echo esc_attr($tab_icon); ?>" aria-hidden="true"></i>
<?php echo aksrt_icon_markup((string) $tab_icon); // pre-escaped ?>
<?php if (!empty($tabbar_settings['show_text'])) : ?><span><?php echo esc_html($tab_text); ?></span><?php endif; ?>
</a>
<?php endforeach;