refactor(modal): remove legacy compatibility paths

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-08-05 00:06:37 +08:00
1 parent bdfe3a461d
commit 34150f3358
18 files changed
+188 -380

No files matched your search

+10 -10
View File
@@ -1,6 +1,6 @@
<?php
/**
* Ajax list + remote modal helpers (zibll ajax-next / RefreshModal parity).
* Ajax list helpers and declarative modal trigger markup.
*
* @package AKSRT
*/
@@ -64,9 +64,9 @@ if (!function_exists('aksrt_get_ajax_next_paginate')) {
}
}
if (!function_exists('aksrt_get_remote_modal_link')) {
if (!function_exists('aksrt_get_modal_link')) {
/**
* Build a remote-modal trigger (zibll zib_get_refresh_modal_link subset).
* Build a declarative modal runtime trigger.
*
* @param array{
* tag?:string,class?:string,text?:string,url?:string,
@@ -74,7 +74,7 @@ if (!function_exists('aksrt_get_remote_modal_link')) {
* query_arg?:array<string,scalar>
* } $args
*/
function aksrt_get_remote_modal_link(array $args = []): string {
function aksrt_get_modal_link(array $args = []): string {
$tag = sanitize_key((string) ($args['tag'] ?? 'a'));
if (!in_array($tag, ['a', 'button', 'span'], true)) {
$tag = 'a';
@@ -90,15 +90,15 @@ if (!function_exists('aksrt_get_remote_modal_link')) {
$height = isset($args['height']) ? (int) $args['height'] : 0;
$mobile = !isset($args['mobile_bottom']) || !empty($args['mobile_bottom']);
$attrs = ' class="' . esc_attr(trim($class . ' aksrt-remote-modal-link')) . '"';
$attrs .= ' data-toggle="AksrtRemoteModal"';
$attrs .= ' data-remote="' . esc_url($url) . '"';
$attrs .= ' data-class="' . esc_attr($data_class) . '"';
$attrs = ' class="' . esc_attr(trim($class . ' aksrt-modal-link')) . '"';
$attrs .= ' data-aksrt-modal="remote"';
$attrs .= ' data-aksrt-modal-url="' . esc_url($url) . '"';
$attrs .= ' data-aksrt-modal-class="' . esc_attr($data_class) . '"';
if ($height > 0) {
$attrs .= ' data-height="' . esc_attr((string) $height) . '"';
$attrs .= ' data-aksrt-modal-height="' . esc_attr((string) $height) . '"';
}
if ($mobile) {
$attrs .= ' mobile-bottom="true"';
$attrs .= ' data-aksrt-modal-mobile-bottom="true"';
}
if ($tag === 'a') {
$attrs .= ' href="' . esc_url($url !== '' ? $url : '#') . '"';