jtsternberg/cmb2-related-links
Composer 安装命令:
composer require jtsternberg/cmb2-related-links
包简介
Custom field for CMB2 which adds a releated links repeatable group field.
关键字:
README 文档
README
Special CMB2 Field that allows users to add a related links repeating field group. This is not a standard field type, but instead a function you use in combination with CMB2::add_field(). Each link can be populated with existing WordPress content by clicking on the search button.
The only required parameter is the 'id' parameter, though you can override almost all of the arguments by passing them in.
This field requires the CMB2 Post Search field.
Example
// Add a related links field. $cmb->add_field( cmb2_related_links_field( array( 'id' => 'yourprefix_related_links' ) ) );
If you are looking to bundle this field in your plugin or theme, you will need to pass the second parameter which is an array of all the translateable strings:
$translateable = array( 'description' => __( 'Add links, or select from related content by clicking the search icon.', 'yourtextdomain' ), 'group_title' => __( 'Link {#}', 'yourtextdomain' ), 'link_title' => __( 'Title', 'yourtextdomain' ), 'link_url' => __( 'URL', 'yourtextdomain' ), 'find_text' => __( 'Find/Select related content', 'yourtextdomain' ), ); $cmb->add_field( cmb2_related_links_field( array( 'id' => 'yourprefix_related_links' ), $translateable ) );
统计信息
- 总下载量: 84
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2016-03-28