- Contributors: borkweb, methnen, Camwyn, zbtirrell, okredo, misterbisson
- Tags: wordpress, taxonomies, terms
- Requires at least: 3.6.1
- Tested up to: 4.0
- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
Registers taxonomies programtically from a config array and provides other helper functions.
We needed a way to add taxonomies that we rely on accross sites and managing those was becomeing cumbersome. This allows us to manage them via a config array.
The plugin also provides workarounds for limitations in WordPress handling of terms in feeds and post term sorting.
There's also a sorted_terms
helper function you can use in plugins and templates like this:
go_taxonomy()->sorted_terms( $post_id, $args );
$post_id
(int) (optional) The ID of the post you want to get sorted terms for
taxonomies
(array)
- array( 'post_tag' ) - Default
number
(int)
- 99 - Default
format
(string)
- list - Default
- array
- name
orderby
(string)
- name - Default
- count : terms ordered by their usage count
order
(string)
- ASC - Default
- DESC
https://github.com/GigaOM/go-taxonomy/
- Place the plugin folder in your
wp-content/plugins/
directory and activate it. - Follow the configuration instructions
- Add a filter on the
go_config
hook that returns an array of taxonomies when the the 2nd paramter isgo-taxonomy
- Config array format example:
array(
'register_taxonomies' => array(
'company' => array(
'object_type' => 'post',
'args' => array(
'label' => 'Companies',
'query_var' => TRUE,
'rewrite' => array(
'slug' => 'company',
'with_front' => TRUE,
'ep_mask' => EP_TAGS,
),
'show_ui' => TRUE,
),
),
'person' => array(
'object_type' => 'post',
'args' => array(
'label' => 'People',
'query_var' => TRUE,
'rewrite' => array(
'slug' => 'person',
'with_front' => TRUE,
'ep_mask' => EP_TAGS,
),
'show_ui' => TRUE,
),
),
'technology' => array(
'object_type' => 'post',
'args' => array(
'label' => 'Technologies and Products',
'query_var' => TRUE,
'rewrite' => array(
'slug' => 'technology',
'with_front' => TRUE,
'ep_mask' => EP_TAGS,
),
'show_ui' => TRUE,
),
),
),
// Taxonomies you want returned as category meta in feeds
'the_category_rss_taxonomies' => array(
'post_tag',
'company',
'person',
'technology',
),
);