コード例 #1
0
 /**
  * Register the term type inside of an Item classes' on_load() method.
  *
  * @param null|string|array $object_types
  * @param array $args
  * @todo Allow taxonomy name to be passed optionally.
  *
  * @link  http://codex.wordpress.org/Function_Reference/register_taxonomy#Parameters
  */
 static function register_taxonomy($object_types, $args = array())
 {
     if (is_string($object_types)) {
         $object_types = explode(',', $object_types);
     }
     $args = wp_parse_args($args, array('label' => WPLib_Terms::_get_taxonomy_label(static::TAXONOMY, 'name'), 'labels' => WPLib_Terms::_get_taxonomy_labels(static::TAXONOMY)));
     if (is_array($object_types)) {
         foreach ($object_types as $object_type) {
             WPLib_Terms::add_object_type(static::TAXONOMY, $object_type);
         }
     }
     WPLib_Terms::_set_taxonomy_args(static::TAXONOMY, $args);
 }