moderntribe/square1-object-meta
Composer 安装命令:
composer require moderntribe/square1-object-meta
包简介
Provides object meta wrappers for square one
README 文档
README
Adding Meta Groups
Create the Meta_Group
<?php namespace Tribe\Example\Object_Meta; use Tribe\Libs\ACF; class Example extends ACF\ACF_Meta_Group { public const NAME = 'example_meta'; public const ONE = 'example_object_meta_one'; public const TWO = 'example_object_meta_two'; public function get_keys() { return [ self::ONE, self::TWO, ]; } public function get_group_config() { $group = new ACF\Group( self::NAME, $this->object_types ); $group->set( 'title', __( 'Example Object Meta', 'tribe' ) ); $group->add_field( $this->get_field_one() ); $group->add_field( $this->get_field_two() ); return $group->get_attributes(); } private function get_field_one() { $field = new ACF\Field( self::NAME . '_' . self::ONE ); $field->set_attributes( [ 'label' => __( 'Example Object Meta #1', 'tribe' ), 'name' => self::ONE, 'type' => 'text', ] ); return $field; } private function get_field_two() { $field = new ACF\Field( self::NAME . '_' . self::TWO ); $field->set_attributes( [ 'label' => __( 'Example Object Meta #2', 'tribe' ), 'name' => self::TWO, 'type' => 'text', ] ); return $field; } }
Register in the Definer
<?php declare( strict_types=1 ); namespace Tribe\Example\Object_Meta; use DI; use Psr\Container\ContainerInterface; use Tribe\Libs\Container\Definer_Interface; use Tribe\Example\Settings; class Object_Meta_Definer implements Definer_Interface { public const GROUPS = 'meta.groups'; public function define(): array { return [ \Tribe\Libs\Object_Meta\Object_Meta_Definer::GROUPS => DI\add( [ DI\get( Example::class ), ] ), Example::class => static function ( ContainerInterface $container ) { return new Example( [ // use one or more of the following options // can be added to post types 'post_types' => [ 'page', 'post' ], // or can be added to taxonomies 'taxonomies' => [ 'category' ], // or can be added to settings screens 'settings_pages' => [ $container->get( Settings\General::class )->get_slug() ], // or can be added to user profiles 'users' => true, ] ); }, ]; } }
moderntribe/square1-object-meta 适用场景与选型建议
moderntribe/square1-object-meta 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.43k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 moderntribe/square1-object-meta 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 moderntribe/square1-object-meta 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 25.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 11
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-only
- 更新时间: 2019-08-02