britco/wp-default-terms
最新稳定版本:v0.1.6
Composer 安装命令:
composer require britco/wp-default-terms
包简介
README 文档
README
A way to set default terms for taxonomies. Similar how to the "default category" functionality works, but for any taxonomy.
Installation
composer require britco/wp-default-terms
Usage
function custom_tax_init() {
register_taxonomy('custom-tax', array('post'), array(
'defaults' => array(
'Foo'
)
));
}
You can also specify different defaults for different post types
function custom_tax_init() {
register_taxonomy('custom-tax', array('post', 'custom_post_type'), array(
'defaults' => array(
'post' => array(
'Foo'
),
'custom_post_type' => array(
'Bar'
)
)
));
}
Also, you can set defaults for already registered taxonomies
$taxonomy = get_taxonomy('post_tag');
$taxonomy->defaults->set(array('paper'));
License
Available under the MIT License.
统计信息
- 总下载量: 65
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-12