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;
     });
 }
 public static function get_brand_site_url($term_id)
 {
     return Taxonomy::get_custom_field_value($term_id, 'site');
 }
Example #3
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);
 }