对小工具进行了一些修复
This commit is contained in:
1 parent
bb9413cba6
commit
411905f919
7 files changed
+128
-43
No files matched your search
@@ -73,6 +73,9 @@ if (!function_exists('aksrt_icon_card')) :
|
||||
|
||||
$style = '';
|
||||
$custom_color = sanitize_hex_color((string) $args['icon_custom_color']);
|
||||
if (!$custom_color && preg_match('/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/', (string) $args['icon_custom_color'])) {
|
||||
$custom_color = (string) $args['icon_custom_color'];
|
||||
}
|
||||
if (!$radius && $custom_color) {
|
||||
$style = ' style="color:' . esc_attr($custom_color) . ';"';
|
||||
}
|
||||
@@ -100,9 +103,9 @@ if (!function_exists('aksrt_icon_card')) :
|
||||
$title = trim((string) $args['title']);
|
||||
$desc = trim((string) $args['desc']);
|
||||
if ($url !== '' && $title !== '') {
|
||||
$title_html = '<a class="main-color" href="' . esc_url($url) . '"' . $tgt . '>' . esc_html($title) . '</a>';
|
||||
$title_html = '<a class="main-color" href="' . esc_url($url) . '"' . $tgt . '>' . wp_kses_post($title) . '</a>';
|
||||
} else {
|
||||
$title_html = $title !== '' ? esc_html($title) : '';
|
||||
$title_html = $title !== '' ? wp_kses_post($title) : '';
|
||||
}
|
||||
|
||||
$body = '';
|
||||
@@ -110,7 +113,7 @@ if (!function_exists('aksrt_icon_card')) :
|
||||
$body .= '<div class="mt10 em12 text-ellipsis">' . $title_html . '</div>';
|
||||
}
|
||||
if ($desc !== '') {
|
||||
$body .= '<div class="muted-color mt6">' . esc_html($desc) . '</div>';
|
||||
$body .= '<div class="muted-color mt6">' . wp_kses_post($desc) . '</div>';
|
||||
}
|
||||
|
||||
$class = trim((string) $args['class'] . ' ' . (string) $args['type']);
|
||||
@@ -269,10 +272,10 @@ if (!function_exists('aksrt_icon_cover_card')) :
|
||||
];
|
||||
$text = '';
|
||||
if (trim(wp_strip_all_tags($title)) !== '' || str_contains($title, '<')) {
|
||||
$text .= '<div class="em12 text-ellipsis font-bold"> ' . wp_kses($title, $allow) . '</div>';
|
||||
$text .= '<div class="em12 text-ellipsis font-bold"> ' . wp_kses_post($title) . '</div>';
|
||||
}
|
||||
if (trim(wp_strip_all_tags($desc)) !== '' || str_contains($desc, '<')) {
|
||||
$text .= '<div class="muted-color mt6 text-ellipsis"> ' . wp_kses($desc, $allow) . '</div>';
|
||||
$text .= '<div class="muted-color mt6 text-ellipsis"> ' . wp_kses_post($desc) . '</div>';
|
||||
}
|
||||
|
||||
$html = '';
|
||||
|
||||
Reference in new issue
Block a user