文章详细页实现全局DOM加载

This commit is contained in:
2026-08-30 20:02:19 +08:00
parent b161d6e5c8
commit 95540ea32c
11 changed files with 13 additions and 282 deletions
+2 -27
View File
@@ -1,8 +1,8 @@
<?php
/**
* Comment form partials — virtual-input + expand toolbar (legacy DOM contract).
* Comment form partials — expand toolbar (legacy DOM contract).
*
* Mirrors legacy() and legacy()
* Mirrors legacy()
* from legacy/inc/functions.
*
* @package AKSRT
@@ -10,31 +10,6 @@
defined('ABSPATH') || exit;
if (!function_exists('aksrt_get_comment_virtual_input_html')) :
/**
* Mobile virtual input bar (legacy: legacy).
*
* @param string $placeholder Placeholder text.
* @param string $target CSS selector for the FixedInput target.
* @return string
*/
function aksrt_get_comment_virtual_input_html(string $placeholder = '', string $target = '#respond'): string {
$user_id = get_current_user_id();
$avatar = get_avatar($user_id, 36, '', '', ['class' => 'avatar']);
if ($placeholder === '') {
$placeholder = __('说点什么吧...', 'aksrt');
}
$html = '<div class="flex ac jsb virtual-input" fixed-input="' . esc_attr($target) . '">';
$html .= '<div class="flex flex1 ac">';
$html .= $avatar;
$html .= '<div class="text-ellipsis simulation mr10">' . esc_html($placeholder) . '</div>';
$html .= '</div>';
$html .= '<span class="but c-blue">' . esc_html__('提交', 'aksrt') . '</span>';
$html .= '</div>';
return $html;
}
endif;
if (!function_exists('aksrt_get_input_expand_but')) :
/**
* legacy-style expand toolbar button + dropdown (legacy: legacy).