承接 britco/wp-default-terms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

britco/wp-default-terms

最新稳定版本:v0.1.6

Composer 安装命令:

composer require britco/wp-default-terms

包简介

README 文档

README

Circle CI

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
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-12