2017 © Pedro Peláez
 

wordpress-plugin wp-default-terms

image

britco/wp-default-terms

  • Thursday, April 7, 2016
  • by pdufour
  • Repository
  • 6 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

wp-default-terms

Circle CI, (*1)

A way to set default terms for taxonomies. Similar how to the "default category" functionality works, but for any taxonomy., (*2)

Installation

composer require britco/wp-default-terms, (*3)

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, (*4)

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, (*5)

$taxonomy = get_taxonomy('post_tag');
$taxonomy->defaults->set(array('paper'));

License

Available under the MIT License., (*6)

The Versions

07/04 2016

dev-feature/cli-sql

dev-feature/cli-sql

  Sources   Download

MIT

The Requires

 

by Paul Dufour

29/09 2015

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Paul Dufour

29/09 2015

v0.1.6

0.1.6.0

  Sources   Download

MIT

The Requires

 

by Paul Dufour

26/09 2015

v0.1.5

0.1.5.0

  Sources   Download

MIT

The Requires

 

by Paul Dufour

14/08 2015

v0.1.4

0.1.4.0

  Sources   Download

MIT

The Requires

 

by Paul Dufour

13/08 2015

v0.1.3

0.1.3.0

  Sources   Download

MIT

The Requires

 

by Paul Dufour

12/08 2015

v0.1.2

0.1.2.0

  Sources   Download

MIT

The Requires

 

by Paul Dufour