This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Super_Custom_Taxonomy Reference
mboynes edited this page Feb 11, 2013
·
1 revision
Super_Custom_Taxonomy
is a wrapper class for WordPress' native register_taxonomy. It works much like Super_Custom_Post_Type.
$tax = new Super_Custom_Taxonomy( $name, $singular=false, $plural=false, $acts_like=false, $register=array() )
Parameters
- string $name
- The Custom Taxonomy slug. Should be singular, all lowercase, letters and numbers only, dashes for spaces
- string $singular
- Optional. The singular form of our tax to be used in menus, etc. If absent, $name gets converted to words
- string $plural
- Optional. The plural form of our tax to be used in menus, etc. If absent, 's' is added to $singular
- string | bool $acts_like
- Optional. Define if this should act like categories or tags. If this starts with 'cat' the tax will act like a category and have hierarchy; any other value and it will act like a tag
- array | bool $register
- Optional. If false, the tax won't be automatically registered. If an array, can override any of the tax defaults. See the WordPress Codex for possible values.
$tax->connect_post_types( $objects )
Connect one or more post types to this tax
Parameters
- string|array $object
- The post type(s) to connect. Either e.g. 'post' or array('post', 'page')
array( 'label' => $this->plural, 'labels' => array( 'name' => _x( $this->plural, $this->name ), 'singular_name' => _x( $this->singular, $this->name ), 'search_items' => _x( 'Search '.$this->plural, $this->name ), 'popular_items' => _x( 'Popular '.$this->plural, $this->name ), 'all_items' => _x( 'All '.$this->plural, $this->name ), 'parent_item' => _x( 'Parent '.$this->singular, $this->name ), 'parent_item_colon' => _x( 'Parent '.$this->singular.':', $this->name ), 'edit_item' => _x( 'Edit '.$this->singular, $this->name ), 'update_item' => _x( 'Update '.$this->singular, $this->name ), 'add_new_item' => _x( 'Add New '.$this->singular, $this->name ), 'new_item_name' => _x( 'New '.$this->singular.' Name', $this->name ), 'separate_items_with_commas' => _x( 'Separate '.strtolower($this->plural).' with commas', $this->name ), 'add_or_remove_items' => _x( 'Add or remove '.strtolower($this->plural), $this->name ), 'choose_from_most_used' => _x( 'Choose from the most used '.strtolower($this->plural), $this->name ), 'menu_name' => _x( $this->plural, $this->name ), ), 'hierarchical' => $this->hierarchical, # Inherited by WP defaults: # 'public' => true, # 'show_in_nav_menus' => true, # 'show_ui' => true, # 'show_tagcloud' => true, # 'rewrite' => true, # 'query_var' => true, # 'update_count_callback' => false, # 'capabilities' => array(), )