webdevstudios/cmb2-attached-posts
Composer 安装命令:
composer require webdevstudios/cmb2-attached-posts
包简介
Custom field for CMB2 for creating post relationships.
README 文档
README
Custom field for CMB2.
The post IDs are saved in an array, which can be rearranged by dragging and dropping posts in the attached posts column. Now incorporates the same search field as the CMB2 Post Search field.
Installation
Follow the example in example-field-setup.php for a demonstration. The example assumes you have both CMB2 and this extension in your mu-plugins directory. If you're using CMB2 installed as a plugin, remove lines 6-9 of the example.
Customization
The example demonstrates how to modify the get_posts query args, and allows you to toggle the thumbnails display as well as a filter search input.
Usage
You can retrieve the meta data using the following:
$attached = get_post_meta( get_the_ID(), '_attached_cmb2_attached_posts', true );
This will return an array of attached post IDs. You can loop through those post IDs like the following example:
foreach ( $attached as $attached_post ) { $post = get_post( $attached_post ); }
Once you have the post data for the post ID, you can proceed with the desired functionality relating to each attached post.
Screenshots
Changelog
1.2.7
- Add default column display output. Simply add
'column' => true,to your field registration.
1.2.6
- Add post type label next to post title when multiple post-types are specified in the query args.
- Open attached-posts links in new window, so as not to leave the current editing window. Props Shelob9, #37, #36.
1.2.5
- Combined the best bits from the CMB2 Post Search field type and this field type, so now you can search for additional posts/pages/etc to be attached. User search is not currently supported. (#7).
1.2.4
- Add support for attaching Users instead of Posts/Custom Posts. Props mckernanin (#27).
1.2.3
- Add loader to manage loading the most recent version of this lib.
1.2.2
- Allow array of post-types. Props @mmcachran.
1.2.1
- Add Search Filter Boxes to Lists. Props @owenconti.
1.2.0
- Add plugin support. Props @yelly.
webdevstudios/cmb2-attached-posts 适用场景与选型建议
webdevstudios/cmb2-attached-posts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 65.76k 次下载、GitHub Stars 达 134, 最近一次更新时间为 2015 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「wordpress」 「post」 「relationship」 「metabox」 「attached」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 webdevstudios/cmb2-attached-posts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webdevstudios/cmb2-attached-posts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 webdevstudios/cmb2-attached-posts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Symfony bundle that integrates the PostNord PHP SDK
Edit Posts button always visible
Extends basic Wordpress features.
Plugin for YOURLS. Default tools to use in some laemmi plugins
PHP module for http request
统计信息
- 总下载量: 65.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 135
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2015-12-09

