定制 webdevstudios/cmb2-post-search-field 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

webdevstudios/cmb2-post-search-field

Composer 安装命令:

composer require webdevstudios/cmb2-post-search-field

包简介

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

README 文档

README

Custom field for CMB2 which adds a post-search dialog for searching/attaching other post IDs.

Adds a new text field type (with a button), post_search_text that adds a quick post search dialog for saving post IDs to a text input.

Example

// Classic CMB2 declaration
$cmb = new_cmb2_box( array(
	'id'           => 'prefix-metabox-id',
	'title'        => __( 'Post Info' ),
	'object_types' => array( 'post', ), // Post type
) );

// Add new field
$cmb->add_field( array(
	'name'        => __( 'Related post' ),
	'id'          => 'prefix_related_post',
	'type'        => 'post_search_text', // This field type
	// post type also as array
	'post_type'   => 'post',
	// Default is 'checkbox', used in the modal view to select the post type
	'select_type' => 'radio',
	// Will replace any selection with selection from modal. Default is 'add'
	'select_behavior' => 'replace',
) );

Screenshots

  1. Field display
    Field display

  2. Search Modal
    Search Modal

If you're looking for a more general way to attach posts (or other custom post types) with a drag and drop interface, you might consider CMB2 Attached Posts Field instead.

统计信息

  • 总下载量: 48.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 66
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 66
  • Watchers: 33
  • Forks: 25
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-12-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固