| 开发者 | mudrava |
|---|---|
| 更新时间 | 2026年11月24日 03:26 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1.5 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
simple:facebookcustom:<name>[lucide_icon] shortcode plus mudrava_get_lucide_icon() helper for templates<?php $icon_name = get_field('your_field_name'); echo esc_html($icon_name); // Returns: 'rocket' ?>
Get SVG Markup (with return_format = 'svg'):
<?php $icon_svg = get_field('your_field_name'); echo $icon_svg; // Returns: <svg>...</svg> ?>
Using the Helper Function:
`<?php
// Basic usage
echo mudrava_get_lucide_icon('rocket');
// With custom attributes
echo mudrava_get_lucide_icon('rocket', [
'class' => 'my-custom-class',
'width' => 32,
'height' => 32,
'stroke' => '#ff0000',
'title' => 'Launch', // accessible title
'mode' => 'sprite', // 'inline' (default) or 'sprite'
]);
?>`
Shortcode
[lucide_icon name="rocket" size="32" title="Launch"]
Custom icons uploaded under Settings → Custom Icons are addressed as custom:<name>,
for example [lucide_icon name="custom:my-logo" title="My Logo"] or
mudrava_get_lucide_icon( 'custom:my-logo' ).
About Custom SVG Icons
Site owners can upload plain SVG icons under Settings → Custom Icons.
Uploads are parsed with DOMDocument (no network access) and reduced to the
same element and attribute allowlist as the bundled sets via wp_kses(), so
scripts, styles, embedded images and unsupported elements never reach storage.
Custom icons are stored as standalone files in the uploads directory, appear
in the picker search, and render with their own colors instead of a forced
currentColor tint.
About Lucide Icons
Lucide is a modern, open-source icon library with 1,700+ carefully crafted icons. The bundled Lucide assets are from lucide-static 1.38.0 and are licensed under ISC.
About Brand Icons
Brand logos are bundled separately from Simple Icons 16.29.0 and are saved with the simple: prefix, for example simple:facebook.
Simple Icons is distributed under CC0-1.0, but individual brand logos and trademarks may still be governed by each brand owner's guidelines and permissions. Check the relevant brand guidelines before using a logo in production. Source and guideline URLs from Simple Icons are bundled in data/brand-icons-meta.json.
mudrava-acf-lucide-field folder to /wp-content/plugins/No. The field type works with Advanced Custom Fields 6.0 or higher. It also works inside ACF Pro field groups such as Repeaters and Flexible Content.
No, the plugin will show an admin notice and the field type will not be available. You must keep ACF active.
No. All icon data is stored locally in the plugin files. No external API calls or CDN requests are made.
Lucide SVG data is bundled in assets/sprite.svg. Brand logo SVG data is bundled in assets/brand-sprite.svg. Search metadata is built into data/icons.json, data/brand-icons.json, data/lucide-tags.php, data/simple-tags.php and byte-offset lookups in data/lucide-index.php and data/simple-index.php. The admin picker loads the catalog lazily through a local REST endpoint (wp-json/mudrava-lucide/v1/icons, logged in by default). Everything runs locally on your server.
Lucide v1 removed most brand icons from the current packages. Version 1.1.0 updates Lucide to lucide-static 1.14.0 and adds a separate Simple Icons brand bundle, which is the recommended direction for brand logos. New brand values are saved as simple:<slug>, and legacy unprefixed social values such as facebook, instagram, twitter, or youtube are resolved against Simple Icons when they no longer exist in Lucide.
Saved values are never rewritten. Icons removed in earlier lucide-static releases - 1.38.0 (angry, annoyed, frown, history, laugh, meh, podcast, smile, smile-plus), 1.66.0 (archive-restore, bold, circle-parking, circle-parking-off, copyright, heading, square-m, square-parking, square-parking-off), 1.70.0 (badge-alert, battery-warning, book-alert, circle-alert, clock-alert, cloud-alert, mail-warning, message-circle-warning, message-square-warning, octagon-alert, search-alert, shield-alert, triangle-alert), 1.73.0 (circle-arrow-out-down-left, circle-arrow-out-down-right, circle-arrow-out-up-left, circle-arrow-out-up-right, square-arrow-out-down-left, square-arrow-out-down-right, square-arrow-out-up-left, square-arrow-out-up-right) and 1.78.0 (fold-horizontal, fold-vertical, unfold-horizontal, unfold-vertical, triangles-centerline-dashed-horizontal, triangles-centerline-dashed-vertical, square-centerline-dashed-horizontal, square-centerline-dashed-vertical) - are mapped to canonical replacements in data/compat-aliases.json, for example smile renders as face-slightly-smiling and triangle-alert as triangle-exclamation-point. Unknown values that have no alias keep saving and surface as a dismissible admin notice; set the field setting "Unknown Icon Values" to "error" to make validation strict instead.
Yes, the Lucide Icon field works perfectly within Repeater fields, Flexible Content fields, and any other ACF field groups.
You can configure the return format in the field settings:
Use the mudrava_get_lucide_icon() helper function with custom attributes for width, height, stroke color, fill color, and CSS classes.
Yes. The plugin ships complete translations for 28 languages: Catalan, Czech, Danish, German, Greek, Spanish, French, Galician, Georgian, Croatian, Hungarian, Indonesian, Italian, Japanese, Norwegian Bokmål, Dutch, Polish, Portuguese (Brazil), Portuguese (Portugal), Romanian, Russian, Slovak, Slovenian, Serbian, Swedish, Turkish, Ukrainian and Simplified Chinese, with the text domain mudrava-acf-lucide-field. Additional languages and community corrections are welcome on translate.wordpress.org; approved translations are delivered automatically as WordPress language packs.
lucide-static 1.78.0 (2102 Lucide symbols, 3472 brand logos; 47 net new icons, including the arrows-/carets-/chevrons-*-axis resize families, the bot-* family, cinema, chocolate-bar, doghouse, jacket, warehouse-waves, nigerian-naira, graph-path, diagram-sankey and folder-network) and simple-icons 16.38.1 (brand artwork refresh: updated Marko and Netlify colors and paths).fold-horizontal, fold-vertical, unfold-horizontal and unfold-vertical now resolve to the arrows-*-axis-dashed family, triangles-centerline-dashed-* to carets-to-axis-dashed-* and square-centerline-dashed-* to square-axis-dashed-*, all verified as the same rendered geometry. The existing flip-horizontal-2 and flip-vertical-2 aliases were repointed to the renamed carets-to-axis-dashed-* successors. Stored values are never rewritten.[lucide_icon] shortcode, custom icon upload, and rendering of all 1.78.0 renames through the alias layer.lucide-static 1.73.0 (2055 Lucide symbols, 3472 brand logos; 34 new icons, including the stroke-line-cap-* and stroke-line-join-* editor glyphs, asterism, cap, cheese, graph-ring, mound-shovel, route-arrow-right, text-pen, question-mark, exclamation-mark and the new *-enter/*-exit arrow family) and simple-icons 16.38.0 (+2 brand logos).*-arrow-out-* became *-arrow-*-exit): circle-arrow-out-down-left, circle-arrow-out-down-right, circle-arrow-out-up-left, circle-arrow-out-up-right, square-arrow-out-down-left, square-arrow-out-down-right, square-arrow-out-up-left and square-arrow-out-up-right now resolve to their renamed twins, which are byte-identical artwork. Stored values are never rewritten.[lucide_icon] shortcode, custom icon upload, and rendering of all 1.73.0 renames through the alias layer.lucide-static 1.70.0 (2029 Lucide symbols, 3470 brand logos; 14 new icons, including the *-exclamation-point family, diagram-flow-horizontal/diagram-flow-vertical, square-dashed-search, package-question-mark, moped and mango) and simple-icons 16.37.0 (+3 brand logos).*-alert and *-warning became *-exclamation-point): badge-alert, battery-warning, book-alert, circle-alert, clock-alert, cloud-alert, mail-warning, message-circle-warning, message-square-warning, octagon-alert, search-alert, shield-alert and triangle-alert now resolve to their renamed twins, which are byte-identical artwork. Stored values are never rewritten.[lucide_icon] shortcode, custom icon upload, and rendering of all 1.70.0 renames through the alias layer.lucide-static 1.66.0 (2015 Lucide symbols, 3467 brand logos; 121 new icons, including the full alphabet glyph sets letter-*, circle-letter-*, square-letter-* and the expanded database and archive families). simple-icons 16.36.0 is unchanged, it was already current.archive-restore, bold, circle-parking, circle-parking-off, copyright, heading, square-m, square-parking and square-parking-off now resolve to their current replacements (archive-arrow-up, letter-b, circle-letter-p, circle-letter-p-off, circle-letter-c, letter-h, square-letter-m, square-letter-p, square-letter-p-off). Stored values are never rewritten.[lucide_icon] shortcode, custom icon upload, and rendering of the 1.66.0 renames through the alias layer.lucide-static 1.61.0 and simple-icons 16.36.0 (1903 Lucide symbols, 3467 brand logos).album, book-marked, building-2, flip-horizontal-2, flip-vertical-2, music, music-2, music-3, music-4 and trash-2 now resolve to their current replacements. Stored values are never rewritten.manage_options instead of calling acf_get_setting() unconditionally.[lucide_icon] shortcode smoke-tested on PHP 8.5.lucide-static 1.38.0 and simple-icons 16.29.0.sprite mode with a footer sprite sheet.data/compat-aliases.json) for icon names removed upstream; saved values are never rewritten.warn/error) controls strict mode.data/allowed-svg.json) and runtime wp_kses sanitization.custom:<name> in the field, picker, shortcode and helper.[lucide_icon] shortcode with mudrava_lucide_icon_svg_args and mudrava_lucide_icon_svg filters.lucide-static 1.14.0.simple:<slug>.