public function register_taxonomy_brand()
 {
     $this->_taxonomy_brand = new Taxonomy('brand', __('Brand', 'wpk15'));
     $this->_taxonomy_brand->add_post_type($this->_post_type_product);
     $this->_taxonomy_brand->add_custom_field('site', __('Web Site', 'wpk15'), 'Url');
     $this->_taxonomy_brand->add_custom_field('country', __('Country', 'wpk15'), function () {
         $field = new Radio();
         $field->set_options(['Ukraine', 'Norway', 'Denmark']);
         return $field;
     });
 }
示例#2
0
 /**
  * Attach a registered taxonomy that will be used with this post type
  *
  * @param Taxonomy $taxonomy taxonomy object
  */
 public function add_taxonomy(Taxonomy $taxonomy)
 {
     $taxonomy->add_post_type($this);
 }