Sfoglia il codice sorgente

:poop: trying to add materials taxonomy

tags/0.9.0
j 5 anni fa
parent
commit
62234032e1
1 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 6
    3
      plugins/cia-post-types/cia-post-types.php

+ 6
- 3
plugins/cia-post-types/cia-post-types.php Vedi File

54
             'show_in_rest'       => true,
54
             'show_in_rest'       => true,
55
             'publicly_queryable' => false
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
         register_post_type( $this->post_type, $args );
58
         register_post_type( $this->post_type, $args );
62
     }
59
     }
154
         'type'             => 'text'
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');

Loading…
Annulla
Salva