feat(widgets): render icon fields with the universal icon picker

The widget FormRenderer icon case and the nav-menu item icon field now
emit the shared picker (preview + choose/clear + editable text input,
delegated events so lazy forms and repeater rows work). Icon values are
sanitized through aksrt_sanitize_icon_value on both save paths so inline
customsvg- markup survives; the widget admin screen enqueues the picker.
This commit is contained in:
2026-09-06 12:59:12 +08:00
parent f629a4f373
commit 009f9874c0
6 changed files with 30 additions and 20 deletions
+5 -1
View File
@@ -802,6 +802,10 @@ class SchemaProvider {
}
}
return $out;
case 'icon':
return function_exists('aksrt_sanitize_icon_value')
? aksrt_sanitize_icon_value((string) $value)
: sanitize_text_field((string) $value);
default:
return sanitize_text_field((string) $value);
}
@@ -993,7 +997,7 @@ class SchemaProvider {
// 自定义面板(验证码服务商等)按对象存储
'custom' => 'array',
'color' => 'string',
'icon' => 'string',
'icon' => 'icon',
'media' => 'url',
'upload' => 'url',
'gallery' => 'attachment_ids',