log1x/modern-acf-options
Composer 安装命令:
composer require log1x/modern-acf-options
包简介
A modern take on ACF Theme Options
README 文档
README
Here lives a simple mu-plugin to modernize and brand theme options created with ACF. No admin panels, no bloat – just a simple filter to optionally customize the CSS properties with your color palette.
Requirements
Installation
Bedrock
Install via Composer:
$ composer require log1x/modern-acf-options
Manual
Download the release .zip and install into wp-content/plugins.
Usage
The styling for Modern ACF Options requires the usage of seamless mode and tabs with their placement set to left.
Example using ACF Builder
use StoutLogic\AcfBuilder\FieldsBuilder; acf_add_options_page([ 'page_title' => get_bloginfo('name'), 'menu_title' => 'Theme Options', 'menu_slug' => 'theme-options', 'update_button' => 'Update Options', 'capability' => 'edit_theme_options', 'position' => '999', 'autoload' => true, ]); $options = new FieldsBuilder('theme_options', [ 'style' => 'seamless', ]); $options ->setLocation('options_page', '==', 'theme-options'); $options ->addTab('general') ->setConfig('placement', 'left') ->addAccordion('customization') ->addImage('logo') ->addAccordion('tracking') ->addText('gtm') ->setConfig('label', 'Google Tag Manager') ->addAccordion('tracking_end')->endpoint() ->addTab('advanced') ->setConfig('placement', 'left') ->addTrueFalse('debug') ->setConfig('ui', '1'); acf_add_local_field_group($options->build());
Customization
To customize the color palette, simply pass an array containing one or more of the colors you would like to change to the acf_color_palette filter:
add_filter('acf_color_palette', function () { return [ 'brand' => '#0073aa', 'trim' => '#181818', ]; });
Disabling Screen Options Tab
use Illuminate\Support\Str; /** * Disable Screen Options on the theme options page. * * @param bool $show * @param \WP_Screen $screen * @return bool */ add_filter('screen_options_show_screen', function ($show, $screen) { if (is_a($screen, 'WP_Screen') && Str::contains($screen->base, 'theme-options')) { return false; } }, 1, 2);
Remove Admin Footer Text
/** * Remove admin footer text. * * @return bool */ add_filter('admin_footer_text', '__return_false', 100);
Development
Modern ACF Options is built using TailwindCSS and compiled with Laravel Mix.
$ yarn install $ yarn run start
Todo
- Continue optimizing/cleaning up existing styles.
- Add styles for ACF switches, input fields (focus, hover), buttons, etc.
Bug Reports
If you discover a bug in Modern ACF Options, please open an issue.
Contributing
Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.
License
Modern ACF Options is provided under the MIT License.
log1x/modern-acf-options 适用场景与选型建议
log1x/modern-acf-options 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 32.39k 次下载、GitHub Stars 达 34, 最近一次更新时间为 2019 年 12 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「wp-admin」 「acf」 「theme-options」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 log1x/modern-acf-options 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 log1x/modern-acf-options 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 log1x/modern-acf-options 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A whitelabeled and modernized wp-login.php
Simple set of helper functions for ACF Fluent auto-loaded with Composer using generic function names.
Drag and drop file upload for ACF-Fields.
Register advanced custom fields with object oriented PHP
Post type selector for Advanced Custom Fields.
Easily create custom meta boxes in WordPress.
统计信息
- 总下载量: 32.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 19
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-15