public function getTaxonomy($key)
    {
        $taxonomies = $this->getTaxonomies();
        if (!Arr::iterable($taxonomies)) {
            return false;
        }
        
        $taxonomy = (array_key_exists($key, $taxonomies)) ? $taxonomies[$key] : false;
        if (!$taxonomy) {
            return false;
        }
        
        // Handle all of these:
        // return array('one', 'two', 'three');
        // return array('one'=>'One Category', 'two', 'three');
        // return array(
        //     'one'=>array('label'=>'One Category'),
        //     'two'=>array('rewrite'=>array('slug'=>'foobar')),
        //     'three'
        // );
        if (is_string($taxonomy)) {
            $taxonomy = (is_numeric($key))
                ? array('label'=>self::getGeneratedTaxonomyLabel($taxonomy))
                : array('label'=>$taxonomy);
        } elseif (is_array($taxonomy) && !array_key_exists('label', $taxonomy)) {
            $taxonomy['label'] = self::getGeneratedTaxonomyLabel($key);
        }

        // Unlike WordPress default, we'll default to hierarchical=true
        // That's just more common for us
        if (!array_key_exists('hierarchical', $taxonomy)) {
            $taxonomy['hierarchical'] = true;
        }
        
        return $taxonomy;
    }
public function getTaxonomy($key)
    {
        $taxonomies = $this->getTaxonomies();
        if (!Arr::iterable($taxonomies)) {
            return false;
        }
        
        $taxonomy = (array_key_exists($key, $taxonomies)) ? $taxonomies[$key] : false;
        if (!$taxonomy) {
            return false;
        }
        
        // Handle all of these:
        // return array('one', 'two', 'three');
        // return array('one'=>'One Category', 'two', 'three');
        // return array(
        //     'one'=>array('label'=>'One Category'),
        //     'two'=>array('rewrite'=>array('slug'=>'foobar')),
        //     'three'
        // );
        if (is_string($taxonomy)) {
            $taxonomy = (is_numeric($key))
                ? array('label'=>self::getGeneratedTaxonomyLabel($taxonomy))
                : array('label'=>$taxonomy);
        } elseif (is_array($taxonomy) && !array_key_exists('label', $taxonomy)) {
            $taxonomy['label'] = self::getGeneratedTaxonomyLabel($key);
        }

        // Unlike WordPress default, we'll default to hierarchical=true
        // That's just more common for us
        if (!array_key_exists('hierarchical', $taxonomy)) {
            $taxonomy['hierarchical'] = true;
        }
        
        return $taxonomy;
    }
public function getTaxonomy ( $ key ) { $ taxonomies = $ this -> getTaxonomies ( ) ; if ( ! Arr :: iterable ( $ taxonomies ) ) { return false ; } $ taxonomy = ( array_key_exists ( $ key , $ taxonomies ) ) ? $ taxonomies [ $ key ] : false ; if ( ! $ taxonomy ) { return false ; } // Handle all of these: // return array('one', 'two', 'three'); // return array('one'=>'One Category', 'two', 'three'); // return array( //     'one'=>array('label'=>'One Category'), //     'two'=>array('rewrite'=>array('slug'=>'foobar')), //     'three' // ); if ( is_string ( $ taxonomy ) ) { $ taxonomy = ( is_numeric ( $ key ) ) ? array ( 'label' => self :: getGeneratedTaxonomyLabel ( $ taxonomy ) ) : array ( 'label' => $ taxonomy ) ; } elseif ( is_array ( $ taxonomy ) && ! array_key_exists ( 'label' , $ taxonomy ) ) { $ taxonomy [ 'label' ] = self :: getGeneratedTaxonomyLabel ( $ key ) ; } // Unlike WordPress default, we'll default to hierarchical=true // That's just more common for us if ( ! array_key_exists ( 'hierarchical' , $ taxonomy ) ) { $ taxonomy [ 'hierarchical' ] = true ; } return $ taxonomy ; }
Get a taxonomy by name
@param string $key
@return array
Get a taxonomy by name