grofftech/meta-box-generator
Composer 安装命令:
composer require grofftech/meta-box-generator
包简介
A WordPress plugin for generating Meta Boxes
关键字:
README 文档
README
Meta Box Generator is a WordPress plugin for allowing database migrations to be done with code.
Requirements
- Composer version 2+ https://getcomposer.org/
Installation
Installing this plugin assumes you are managing plugins for a WordPress site with composer or wp-packagist. It is currently not part of the WordPress plugin repository so it can't be installed with wp-packagist.
Add the following configuration to your composer.json. If you are managing plugins with wp-packagist, this configuration may already be present.
"extra": {
"installer-paths": {
"plugins/{$name}/": ["type:wordpress-plugin"]
}
}
Install with composer
composer require grofftech\wp-migrator
Usage
Metabox Configuration
Hook into the filter mbg_add_metabox_configuration_files and include file(s) that have an array returned like the sample below. Make sure the filter is configured in your plugin during its initialization, so that it can be properly registered.
add_filter( 'mbg_add_metabox_configuration_files', 'add_files');
function add_files( $files ) {
$files[] = // Directory path to your file
return $files;
}
For your returned array, use the sample below. Replace the metabox.sample key in the array to the name of the meta box you are configuring (e.g. metabox.article). Update the add_meta_box configuration to be specific for your meta box. See https://developer.wordpress.org/reference/functions/add_meta_box/. Update the view key to a directory path of your view file for the meta box.
return array(
'metabox.sample' => array(
'add_meta_box' => array(
'title' => __('Sample Meta Box', 'your_text_domain'), // The title of the meta box
'screen' => 'post', // The post type
'context' => 'advanced', // Where it should be displayed for the screen
'priority' => 'default', // default, high, low
'callback_args' => null, // Additional params for the callback
'include_custom_fields' => false
),
'custom_fields' => array()
),
'view' => // Directory path to your view file
)
);
If you need to include custom fields in your meta box, set the include_custom_fields key to true and configure an array of options for your custom view(s) using the sample below.
'custom_fields' => array(
'sample_custom_field' => array( // replace sample_custom_field your your custom field name
'is_single' => true, // ?
'default' => '', // ?
'delete_state' => '', // ?
'sanitize' => 'sanitize_text_field' // A WordPress sanitize function for your custom field
),
// Another custom field configuration would go here if multiple, configured just like above
),
See https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/ for more information about custom meta boxes.
grofftech/meta-box-generator 适用场景与选型建议
grofftech/meta-box-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「wordpress」 「wp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 grofftech/meta-box-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 grofftech/meta-box-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 grofftech/meta-box-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Plugin for YOURLS. Default tools to use in some laemmi plugins
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
Allows polling user for event dates and times.
Support swipe touch gestures to navigate in paginated lists and on Tidypics image pages.
Add a postscript to every email notification sent out to users.
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-09-13