Conditions | 5 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function get($post_type) { |
||
34 | $data = []; |
||
35 | |||
36 | if($post_type) { |
||
37 | |||
38 | foreach(\get_object_taxonomies($post_type, 'objects') as $index => $taxonomy) { |
||
39 | // Only accept taxonomies which visible to admin and reader |
||
40 | if($taxonomy->show_ui and $taxonomy->show_in_menu) { |
||
41 | |||
42 | $data[$index]['name'] = $taxonomy->name; |
||
43 | $data[$index]['label'] = $taxonomy->label; |
||
44 | |||
45 | } |
||
46 | |||
47 | } |
||
48 | |||
49 | } |
||
50 | |||
51 | return $data; |
||
52 | } |
||
53 | |||
64 | } |