开发者 |
ndiego
outermostdesign |
---|---|
更新时间 | 2024年3月24日 19:38 |
PHP版本: | 7.0 及以上 |
WordPress版本: | 6.5 |
版权: | GPL-2.0-or-later |
版权网址: | 版权信息 |
Currently, the Icon Block only includes the WordPress icon library. That said, the plugin allows you to render any SVG-based icon by simply copying/pasting the code into the icon text area when using the "Add custom icon" option! See the screenshots for reference. This gives you complete flexibility and allows you to use practically any icon you want. A great source for free SVG icons is Google's Material Icons project, Font Awesome, and Iconic, to name a few. The Icon Block also allows you to register your own custom block library. This needs to be done externally in your theme or via a plugin but provides complete flexibility over the icons available in the plugin. Learn more.
The Icon Block includes controls for the icon's color and background. However, if your SVG icon has hard-coded color/fill values, the plugin will respect those instead of any applied custom colors.
By default, WordPress does not allow you to add SVG files to your Media Library, but you can enable this functionality using plugins like Safe SVG. If SVG uploads are enabled, you will see the option to insert icons from Media Library in the Icon Block.
WordPress only allows Administrators and Editors to save "Unfiltered HTML" content, which includes SVGs. The Icon Block will not work properly for users who are at the Author level or lower. Note that WordPress multisite installations have additional restrictions. "Unfiltered HTML" is restricted to Super Admins on multisite. To enable "Unfiltered HTML" content for site Administrators and Editors, you will need to use a code snippet, the Unfiltered MU plugin, or something similar. Regrettably, this is a WordPress restriction and needs to be handled outside of the Icon Block.
ToolsPanel
implementations and support setting resets.iconBlock.enableCustomIcons
filter.title
archiveTitle
, commentTitle
, postTitle
, and queryTitle
post
, postTerms
, queryTitle
, removeSubmenu
, and row
alignJustifyAlt
, cogAlt
, and trashFilled
style
attributes would not render correctly. Thanks @endres for reporting this issue.aria-label
on the icon and link.isFullScreen
to better resemble core modals.