进行了一些小修复
This commit is contained in:
1 parent
2e7cc56043
commit
d37c34f71c
114 files changed
+86
-181
No files matched your search
@@ -39,12 +39,12 @@ if (!function_exists('aksrt_get_input_expand_but')) :
|
||||
/**
|
||||
* legacy-style expand toolbar button + dropdown (legacy: legacy).
|
||||
*
|
||||
* @param string $type smilie|code|image|quick|link.
|
||||
* @param string $type code|image|quick|link.
|
||||
* @param mixed $arg1 Type-specific arg.
|
||||
* @param array<string,mixed> $ctx Optional context (upload, phrases).
|
||||
* @return string
|
||||
*/
|
||||
function aksrt_get_input_expand_but(string $type = 'smilie', $arg1 = null, array $ctx = []): string {
|
||||
function aksrt_get_input_expand_but(string $type, $arg1 = null, array $ctx = []): string {
|
||||
$but = '';
|
||||
$dropdown = '';
|
||||
|
||||
@@ -78,16 +78,6 @@ if (!function_exists('aksrt_get_input_expand_but')) :
|
||||
$dropdown = '<div class="relative dropdown-quick-often"><div class="quick-often-box scroll-y mini-scrollbar">' . $sys_lists . '</div></div>';
|
||||
break;
|
||||
|
||||
case 'smilie':
|
||||
$map = function_exists('aksrt_comment_smilie_map') ? aksrt_comment_smilie_map() : [];
|
||||
$smilie_icon = '';
|
||||
foreach ($map as $key => $url) {
|
||||
$smilie_icon .= '<a class="smilie-icon" href="javascript:;" data-smilie="' . esc_attr((string) $key) . '"><img src="' . esc_url((string) $url) . '" alt="[' . esc_attr((string) $key) . ']" /></a>';
|
||||
}
|
||||
$but = '<a class="but btn-input-expand input-smilie mr6" href="javascript:;"><i class="fa fa-fw fa-smile-o" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('表情', 'aksrt') . '</span></a>';
|
||||
$dropdown = '<div class="dropdown-smilie scroll-y mini-scrollbar">' . $smilie_icon . '</div>';
|
||||
break;
|
||||
|
||||
case 'code':
|
||||
$but = '<a class="but btn-input-expand input-code mr6" href="javascript:;"><i class="fa fa-fw fa-code" aria-hidden="true"></i><span class="hide-sm">' . esc_html__('代码', 'aksrt') . '</span></a>';
|
||||
$dropdown = '<div class="dropdown-code">';
|
||||
@@ -124,7 +114,7 @@ endif;
|
||||
|
||||
if (!function_exists('aksrt_render_comment_expand_toolbar')) :
|
||||
/**
|
||||
* Render left-side expand tools based on settings (legacy order: smilie/code/image/link/quick).
|
||||
* Render left-side expand tools based on settings (legacy order: code/image/link/quick).
|
||||
*
|
||||
* @param array<string,mixed> $ctx Comments context.
|
||||
*/
|
||||
@@ -134,9 +124,6 @@ if (!function_exists('aksrt_render_comment_expand_toolbar')) :
|
||||
$phrases = is_array($ctx['quick_phrases'] ?? null) ? $ctx['quick_phrases'] : [];
|
||||
$quick_s = !isset($ctx['quick_s']) || !empty($ctx['quick_s']);
|
||||
|
||||
if (!empty($toolbar['smilie'])) {
|
||||
echo aksrt_get_input_expand_but('smilie'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
if (!empty($toolbar['code'])) {
|
||||
echo aksrt_get_input_expand_but('code'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user