修复了一些问题

This commit is contained in:
2026-08-23 20:59:34 +08:00
parent af52f9e94d
commit d7634d1ff6
9 changed files with 316 additions and 24 deletions
+3 -5
View File
@@ -34,10 +34,8 @@ remove_action('wp_footer', 'aksrt_render_footer_tabbar', 20);
remove_action('wp_footer', 'aksrt_render_float_buttons', 30);
$ui = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::sign_page_ui() : [];
$images = $ui['background'] ?? [];
if (is_string($images)) {
$images = array_filter(array_map('absint', explode(',', $images)));
}
$background_url = is_array($images) && $images ? (string) wp_get_attachment_url((int) $images[array_rand($images)]) : '';
$background_id = $images ? (int) $images[array_rand($images)] : 0;
$background_url = $background_id > 0 ? (string) wp_get_attachment_image_url($background_id, 'full') : '';
$theme_mode = (string) ($ui['theme_mode'] ?? 'no');
$position = (string) ($ui['card_position'] ?? 'right');
$aksrt_auth_context = [
@@ -59,7 +57,7 @@ $aksrt_auth_context = [
</head>
<body <?php body_class('page-template-user-sign ' . ($theme_mode !== 'no' ? $theme_mode : '')); ?>>
<?php wp_body_open(); ?>
<div class="sign-page-background"<?php echo $background_url !== '' ? ' style="background-image:url(\'' . esc_url($background_url) . '\')"' : ''; ?>></div>
<?php if ($background_url !== '') : ?><div class="sign-page-background" style="background-image:url('<?php echo esc_url($background_url); ?>')"></div><?php endif; ?>
<?php if (!empty($ui['show_header']) && !$interim) : ?><header class="sign-topbar"><a href="<?php echo esc_url(home_url('/')); ?>"><?php echo esc_html(get_bloginfo('name')); ?></a><a href="<?php echo esc_url(home_url('/')); ?>"><?php esc_html_e('返回首页', 'aksrt'); ?></a></header><?php endif; ?>
<main class="sign-page sign-card-position-<?php echo esc_attr($position); ?>">
<div class="sign-page-card">
+9 -9
View File
@@ -13,13 +13,13 @@ if (is_user_logged_in() || (class_exists('\AKSRT\Settings\Settings') && \AKSRT\S
$modal_ui = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::modal_ui() : [];
$images = $modal_ui['background'] ?? [];
if (is_string($images)) {
$images = array_filter(array_map('absint', explode(',', $images)));
}
$image_url = '';
if (is_array($images) && $images) {
$image_url = (string) wp_get_attachment_url((int) $images[array_rand($images)]);
}
$image_id = $images ? (int) $images[array_rand($images)] : 0;
$image_html = $image_id > 0 ? wp_get_attachment_image($image_id, 'full', false, [
'class' => 'fit-cover radius8',
'alt' => get_bloginfo('name'),
'loading' => 'lazy',
'decoding' => 'async',
]) : '';
$auto = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::sign_modal_auto() : ['enabled' => false, 'waiting' => 5, 'expires' => 1];
$wechat = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_weixingzh_settings() : [];
$initial_tab = !empty($wechat['priority']) && class_exists('\AKSRT\Auth\WeixinGzh') && \AKSRT\Auth\WeixinGzh::is_enabled() ? 'oauth' : 'signin';
@@ -30,12 +30,12 @@ $aksrt_auth_context = [
'redirect_to' => home_url('/'),
];
?>
<div id="u_sign" class="aksrt-auth-modal<?php echo $image_url !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
<div id="u_sign" class="aksrt-auth-modal<?php echo $image_html !== '' ? ' has-sign-img' : ''; ?>" aria-hidden="true" role="dialog" aria-modal="true" data-auth-modal data-auto="<?php echo !empty($auto['enabled']) ? '1' : '0'; ?>" data-auto-wait="<?php echo esc_attr((string) $auto['waiting']); ?>" data-auto-expires="<?php echo esc_attr((string) $auto['expires']); ?>">
<div class="auth-modal-backdrop" data-auth-close></div>
<div class="modal-dialog">
<div class="modal-content">
<button type="button" class="auth-modal-close" data-auth-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times"></i></button>
<?php if ($image_url !== '') : ?><div class="sign-img" style="background-image:url('<?php echo esc_url($image_url); ?>')"></div><?php endif; ?>
<?php if ($image_html !== '') : ?><div class="sign-img"><?php echo $image_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div><?php endif; ?>
<?php require get_template_directory() . '/templates/parts/auth-content.php'; ?>
</div>
</div>