huubl/acf-icon-picker
Composer 安装命令:
composer require huubl/acf-icon-picker
包简介
Add ACF field for selecting SVG icons.
README 文档
README
Allows you to create an 'icon-picker' acf-field.
Please note
I am no longer developing this plugin myself, please use https://github.com/smithfield-studio/acf-svg-icon-picker instead.
Description
Add the svg icons you want to be available in your theme to an acf folder inside an img folder in your theme. The field returns the name of the svg.
Compatibility
This ACF field type is compatible with:
- ACF 6
- ACF 5
Screenshots
Installation
via Composer
- Add a line to your repositories array:
{ "type": "git", "url": "https://github.com/houke/acf-icon-picker" } - Add a line to your require block:
"houke/acf-icon-picker": "dev-master" - Run:
composer update
Manually
- Copy the
acf-icon-pickerfolder into yourwp-content/pluginsfolder - Activate the Icon Selector plugin via the plugins admin page
- Create a new field via ACF and select the Icon Selector type
Filters
Use the below filters to override the default icon folder, path, and / or URL:
// modify the path to the icons directory add_filter( 'acf_icon_path_suffix', 'acf_icon_path_suffix' ); function acf_icon_path_suffix( $path_suffix ) { return 'assets/img/icons/'; } // modify the path to the above prefix add_filter( 'acf_icon_path', 'acf_icon_path' ); function acf_icon_path( $path_suffix ) { return plugin_dir_path( __FILE__ ); } // modify the URL to the icons directory to display on the page add_filter( 'acf_icon_url', 'acf_icon_url' ); function acf_icon_url( $path_suffix ) { return plugin_dir_url( __FILE__ ); }
For Sage/Bedrock edit filters.php:
/// modify the path to the icons directory add_filter('acf_icon_path_suffix', function ( $path_suffix ) { return '/assets/images/icons/'; // After assets folder you can define folder structure } ); // modify the path to the above prefix add_filter('acf_icon_path', function ( $path_suffix ) { return '/app/public/web/themes/THEME_NAME/resources'; } ); // modify the URL to the icons directory to display on the page add_filter('acf_icon_url', function ( $path_suffix ) { return get_stylesheet_directory_uri(); } );
Changelog
- 1.9.1 - ACF 6 compatibility fix. Thanks to idflood
- 1.9.0 - Fix issue with Gutenberg preview not updating when removing. Thanks to cherbst
- 1.8.0 - Fix issue with Gutenberg not saving icon. Thanks to tlewap
- 1.7.0 - 2 new filters for more control over icon path. Thanks to benjibee
- 1.6.0 - Performance fix with lots of icons. Thanks to idflood
- 1.5.0 - Fix issue where searching for icons would break preview if icon name has space
- 1.4.0 - Add filter to change folder where svg icons are stored
- 1.3.0 - Adding close option on modal
- 1.2.0 - Adding search filter input to filter through icons by name
- 1.1.0 - Add button to remove the selected icon when the field is not required
- 1.0.0 - First release
huubl/acf-icon-picker 适用场景与选型建议
huubl/acf-icon-picker 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.87k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 huubl/acf-icon-picker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 huubl/acf-icon-picker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.87k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-06-27