feat(icons): add the FA5 catalog, REST endpoint and unified icon helpers

Mirror the reference theme's universal picker on FA5: a generated full
catalog of the bundled FA5 Free 5.15.4 fonts (src/Icons/fa5-icons.php,
generated from the shipped CSS + SVG fonts), a zibsvg group parsed from
the runtime sprite so it cannot drift, and GET /aksrt/v1/icons/catalog.

Shared admin pieces: aksrt_icon_markup()/aksrt_sanitize_icon_value()
with an SVG allowlist, the picker field/modal assets, and one canonical
aksrt-font-awesome handle registered through aksrt_enqueue_fontawesome().
This commit is contained in:
2026-09-06 12:59:03 +08:00
parent 9496db5171
commit f629a4f373
12 changed files with 2541 additions and 18 deletions
+11 -5
View File
@@ -111,11 +111,16 @@ class Admin {
}
// Use the same local FA5 pack as the public stack.
wp_enqueue_style(
'aksrt-font-awesome',
get_template_directory_uri() . '/assets/fontawesome5/css/all.min.css',
[],
'5.15.4'
aksrt_enqueue_fontawesome();
// Frontend SVG sprite (defines window.aksrt_svgs and injects the symbol
// sheet) so schema icon fields can preview built-in zibsvg values.
wp_enqueue_script(
'aksrt-svg-sprite',
get_template_directory_uri() . '/assets/js/runtime/svg-icon.js',
['jquery'],
(string) filemtime(get_template_directory() . '/assets/js/runtime/svg-icon.js'),
true
);
wp_enqueue_script(
@@ -186,6 +191,7 @@ class Admin {
CommentController::class,
MessageController::class,
AIController::class,
\AKSRT\Icons\IconController::class,
];
foreach ($controllers as $class_name) {