Sfoglia il codice sorgente

:sparkles: added eta fields for techniques

tags/0.9.0
J 4 anni fa
parent
commit
8619bd0404

+ 2
- 2
plugins/cia-post-types/includes/custom-metaboxes.php Vedi File

@@ -39,7 +39,7 @@
39 39
         $cmb = new_cmb2_box([
40 40
             'id'              => 'hero_metabox',
41 41
             'title'           => __( 'Hero', 'cmb2' ),
42
-            'object_types'    => ['artist', 'episode', 'event', 'exhibition', 'guide', 'short', 'object', 'publication'], // Post type
42
+            'object_types'    => ['artist', 'episode', 'event', 'exhibition', 'guide', 'short', 'object', 'publication',  'technique'], // Post type
43 43
             'show_in_rest'    => WP_REST_Server::READABLE
44 44
         ]);
45 45
 
@@ -62,7 +62,7 @@
62 62
         $cmb = new_cmb2_box([
63 63
             'id'           => 'stick_metabox',
64 64
             'title'        => __( 'Sticky Post', 'cmb2' ),
65
-            'object_types' => ['artist', 'episode', 'event', 'exhibition', 'guide', 'short', 'object', 'publication', 'page', 'post'], // Post type
65
+            'object_types' => ['artist', 'episode', 'event', 'exhibition', 'guide', 'short', 'object', 'publication', 'page', 'post', 'technique'], // Post type
66 66
             'show_in_rest' => WP_REST_Server::READABLE
67 67
         ]);
68 68
 

+ 1
- 1
plugins/cia-post-types/includes/custom-taxonomies.php Vedi File

@@ -2,7 +2,7 @@
2 2
     function create_materials_taxonomy() {
3 3
         $post_types_that_show_materials = [
4 4
             'artist', 'guide', 'short',
5
-            'object', 'publication',
5
+            'object', 'publication', 'technique'
6 6
         ];
7 7
         register_taxonomy('material', $post_types_that_show_materials, ['label' => 'Materials']);
8 8
     }

+ 29
- 0
plugins/cia-post-types/includes/p2p-mappings.php Vedi File

@@ -42,6 +42,13 @@ function all_connection_types() {
42 42
         'reciprocal' => true,
43 43
         'admin_box' => $admin_box
44 44
     ]);
45
+    p2p_register_connection_type([
46
+        'name' => 'artists_to_shorts',
47
+        'to' => 'artist',
48
+        'from' => 'short',
49
+        'reciprocal' => true,
50
+        'admin_box' => $admin_box
51
+    ]);
45 52
     p2p_register_connection_type([
46 53
         'name' => 'artists_to_techniques',
47 54
         'to' => 'artist',
@@ -71,6 +78,20 @@ function all_connection_types() {
71 78
         'reciprocal' => true,
72 79
         'admin_box' => $admin_box
73 80
     ]);
81
+    p2p_register_connection_type([
82
+        'name' => 'episodes_to_shorts',
83
+        'to' => 'episode',
84
+        'from' => 'short',
85
+        'reciprocal' => true,
86
+        'admin_box' => $admin_box
87
+    ]);
88
+    p2p_register_connection_type([
89
+        'name' => 'episodes_to_techniques',
90
+        'to' => 'episode',
91
+        'from' => 'technique',
92
+        'reciprocal' => true,
93
+        'admin_box' => $admin_box
94
+    ]);
74 95
 
75 96
     p2p_register_connection_type([
76 97
         'name' => 'events_to_exhibitions',
@@ -94,6 +115,14 @@ function all_connection_types() {
94 115
         'reciprocal' => true,
95 116
         'admin_box' => $admin_box
96 117
     ]);
118
+
119
+    p2p_register_connection_type([
120
+        'name' => 'shorts_to_techniques',
121
+        'to' => 'short',
122
+        'from' => 'technique',
123
+        'reciprocal' => true,
124
+        'admin_box' => $admin_box
125
+    ]);
97 126
 }
98 127
 add_action( 'p2p_init', 'all_connection_types' );
99 128
 

Loading…
Annulla
Salva