feat(tickets): make ticket title/content/reply length limits configurable
Add ticket_title_max / ticket_content_max / ticket_reply_max to the users/ticket schema (PHP + SPA) with clamped TicketSettings readers. All write paths (front REST, admin REST, note REST, native admin page) and front-end maxlength/counters now read the configured limits. Remove the hardcoded TICKET_CONTENT_MAX constant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6681b0c306
commit
63ab8b8fc9
13 files changed
+71
-28
No files matched your search
@@ -45,8 +45,9 @@ trait UsersMenusTicketsList {
|
||||
}
|
||||
echo '</select></label>';
|
||||
printf(
|
||||
'<label class="is-wide"><span>%s</span><input type="text" name="title" maxlength="200" required class="large-text" /></label>',
|
||||
esc_html__('标题', 'aksrt')
|
||||
'<label class="is-wide"><span>%s</span><input type="text" name="title" maxlength="%d" required class="large-text" /></label>',
|
||||
esc_html__('标题', 'aksrt'),
|
||||
\AKSRT\Ticket\TicketSettings::title_max()
|
||||
);
|
||||
if (\AKSRT\Ticket\TicketSettings::order_link_enabled()) {
|
||||
printf(
|
||||
@@ -58,7 +59,7 @@ trait UsersMenusTicketsList {
|
||||
printf(
|
||||
'<label class="is-wide"><span>%s</span><textarea name="content" rows="4" maxlength="%d" required class="large-text"></textarea></label>',
|
||||
esc_html__('问题描述', 'aksrt'),
|
||||
(int) self::TICKET_CONTENT_MAX
|
||||
\AKSRT\Ticket\TicketSettings::content_max()
|
||||
);
|
||||
echo '</div>';
|
||||
printf(
|
||||
|
||||
Reference in new issue
Block a user