ivanyankov/meta-fields-builder
最新稳定版本:v1.1
Composer 安装命令:
composer require ivanyankov/meta-fields-builder
包简介
A robust, flexible, and easy-to-use PHP library to quickly create, register, and reuse meta fields and meta boxes configurations, and keep them in your source code repository.
README 文档
README
A robust, flexible, and easy-to-use PHP library to quickly create, register, and reuse meta fields and meta boxes configurations, and keep them in your source code repository.
Install
Use composer to install:
composer require ivanyankov/meta-fields-builder
If your project isn't using composer, you can require the autoload.php file.
Usage
This should give you a comprehensive view of how to create meta boxes with fields, where you can specify not only the fields themselves but also where these meta boxes should appear.
Simple Example
use Yankov\MetaFieldsBuilder\MetaBox\MetaBoxBuilder; use Yankov\MetaFieldsBuilder\Fields\TextField; $fields = [ new TextField('text_field_name', 'Text Field') ]; $metaBox = MetaBoxBuilder::make('custom_meta_box_id', 'Advanced Custom Meta Box', $fields, 'post');
Get the saved data by calling the below WordPress function.
$field_value = get_post_meta($post_id, "text_field_name", true);
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-10-05