Skip to content

Commit

Permalink
Merge branch 'JustinSainton-master'. Add setter method. Props [@Justi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Aug 30, 2014
2 parents 4be649a + 155d2f2 commit 74172ec
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 82 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Taxonomy_Single_Term
==================

Version: 0.2.0
Version: 0.2.1

Taxonomies in WordPress are super powerful. The purpose of taxonomies is to create relationships among post types. Unfortunately the UI doesn't effectively enforce limiting to a single term.
Taxonomies in WordPress are super powerful. The purpose of taxonomies is to create relationships among post types. Unfortunately the UI doesn't effectively enforce limiting to a single term.

This library helps you remove and replace the built-in taxonomy metabox with a radio or select metabox.

Expand All @@ -13,7 +13,7 @@ Usage
------------

1. Include the `class.taxonomy-single-term.php` file from within your plugin or theme
2. Initialize the class (update the taxonomy slug with your own):
2. Initialize the class (update the taxonomy slug with your own):
`$custom_tax_mb = new Taxonomy_Single_Term( 'custom-tax-slug' );`

#### Optional
Expand All @@ -22,25 +22,29 @@ Usage
2. Update optional class properties like:
```php
// Priority of the metabox placement.
$custom_tax_mb->priority = 'low';
$custom_tax_mb->set( 'priority', 'low' );

// 'normal' to move it under the post content.
$custom_tax_mb->context = 'normal';
$custom_tax_mb->set( 'context', 'normal' );

// Custom title for your metabox
$custom_tax_mb->metabox_title = __( 'Custom Metabox Title', 'yourtheme' );
$custom_tax_mb->set( 'context', __( 'Custom Metabox Title', 'yourtheme' ) );

// Makes a selection required.
$custom_tax_mb->force_selection = true;
$custom_tax_mb->set( 'force_selection', true );

// Will keep radio elements from indenting for child-terms.
$custom_tax_mb->indented = false;
$custom_tax_mb->set( 'indented', false );

// Allows adding of new terms from the metabox
$custom_tax_mb->allow_new_terms = true;
$custom_tax_mb->set( 'allow_new_terms', true );
```

#### Change Log
**0.2.1**
* Add setter method. Props [@JustinSainton](https://github.com/JustinSainton)
* Add getter magic method for retrieving properties

**0.2.0**
* Ability to choose Select elements vs Radios. Props [@jchristopher](https://github.com/jchristopher)
* Rename plugin. Props [@jchristopher](https://github.com/jchristopher)
Expand Down
Loading

0 comments on commit 74172ec

Please sign in to comment.