Просмотр исходного кода

:poop: trying to add materials taxonomy

tags/0.9.0
j 5 лет назад
Родитель
Сommit
62234032e1
1 измененных файлов: 6 добавлений и 3 удалений
  1. 6
    3
      plugins/cia-post-types/cia-post-types.php

+ 6
- 3
plugins/cia-post-types/cia-post-types.php Просмотреть файл

@@ -54,9 +54,6 @@ class PostType {
54 54
             'show_in_rest'       => true,
55 55
             'publicly_queryable' => false
56 56
         ];
57
-        
58
-        if( $this->post_type == 'artist' ) { $args['taxonomies'] = ['category']; }
59
-        if( $this->post_type == 'event' ) { $args['taxonomies'] = ['type']; }
60 57
 
61 58
         register_post_type( $this->post_type, $args );
62 59
     }
@@ -154,3 +151,9 @@ function cmb2_artist_sort_metaboxes() {
154 151
         'type'             => 'text'
155 152
     ) );
156 153
 }
154
+
155
+function create_materials_taxonomy() {
156
+    $post_types_that_show_materials = [ 'artist' ];
157
+    register_taxonomy("material", $post_types_that_show_materials, [ "label" => "Materials"]);
158
+}
159
+add_action('init', 'create_materials_taxonomy');

Загрузка…
Отмена
Сохранить