agence-adeliom/acf-icon-picker
Composer 安装命令:
composer require agence-adeliom/acf-icon-picker
包简介
README 文档
README
Permet de créer un champ ACF de type 'icon-picker'.
Attention, dans icomoon, bien penser à exporter la version classe et ne pas baser la font sur le tag i (conflit avec le BO)
[class^="icon-"], [class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: '#{$icomoon-font-family}' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
}
Description
Utilisation des icônes icomoon à mettre en place directement dans le dossier du thème /assets/fonts (tout extraire à la raicne de ce dossier).
Compatibilité
Champ ACF compatible avec : [x] ACF 5
Ajouté directement en tant que fonction pour la compatibilité avec les champs ACF wordplate
Screenshots
Installation
- Mettre à jour le composer.json
"repositories": { ... "adeliom-icon-picker": { "type": "vcs", "url": "https://github.com/agence-adeliom/acf-icon-picker.git" }, ... } ... "require": { ... "agence-adeliom/acf-icon-picker": "dev-master" }
- Laner un
composer update - Activer le plugin depuis l'administration de Wordpress
- Créer un champ à l'endroit ou vous le souhaitez comme n'importe quel autre champ
use Adeliom\Acf\Fields\IconPicker; ... IconPicker::make("Icône", "icon")->required()->icons(['name-of-your-icon', '....']);
Ancienne version
acf_icon_picker([ 'name' => 'icon-picker', 'label' => __('Icone', ''), 'required' => true, ... ])
Filters
Pour modifier les différents chemin ou URLs dans le cas où ils devaient se trouver ailleurs que dans le dossier VotreTheme/assets/fonts/, voici quelques filtres :
// 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__ ); } // allowed to choose between Image or Font add_filter( 'acf_icon_image', 'acf_icon_image' ); function acf_icon_image() { return true; } // modify the format (default : svg) add_filter( 'acf_icon_image_format', 'acf_icon_image_format' ); function acf_icon_image_format() { return "png"; } // modify the filename (fantasticon) add_filter( 'acf_icon_filename', 'acf_icon_filename' ); function acf_icon_filename() { return "icons.scss"; }
agence-adeliom/acf-icon-picker 适用场景与选型建议
agence-adeliom/acf-icon-picker 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 2.15k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2022 年 04 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 agence-adeliom/acf-icon-picker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 agence-adeliom/acf-icon-picker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-04-29