|
|
@@ -169,7 +169,52 @@ add_action( 'after_setup_theme', 'craft_post_thumbnails' );
|
|
169
|
169
|
add_theme_support('editor-styles');
|
|
170
|
170
|
add_editor_style( 'editor-style.css' );
|
|
171
|
171
|
|
|
172
|
|
-// ADMIN CUSTOM COLUMNS
|
|
|
172
|
+// Custom Dashboard Menu Order
|
|
|
173
|
+function custom_menu_order($menu_ord) {
|
|
|
174
|
+ if (!$menu_ord) return true;
|
|
|
175
|
+ return array(
|
|
|
176
|
+ 'index.php', // this represents the dashboard link
|
|
|
177
|
+ 'upload.php', // this is the MEDIA library
|
|
|
178
|
+ 'edit.php', // default POST
|
|
|
179
|
+ 'edit.php?post_type=artist',
|
|
|
180
|
+ 'edit.php?post_type=exhibition',
|
|
|
181
|
+ 'edit.php?post_type=event',
|
|
|
182
|
+ 'edit.php?post_type=episode',
|
|
|
183
|
+ 'edit.php?post_type=short',
|
|
|
184
|
+ 'edit.php?post_type=technique',
|
|
|
185
|
+ 'edit.php?post_type=guide',
|
|
|
186
|
+ 'edit.php?post_type=object',
|
|
|
187
|
+ 'edit.php?post_type=publication',
|
|
|
188
|
+ 'edit.php?post_type=page', // PAGES
|
|
|
189
|
+ );
|
|
|
190
|
+}
|
|
|
191
|
+add_filter('custom_menu_order', 'custom_menu_order');
|
|
|
192
|
+add_filter('menu_order', 'custom_menu_order');
|
|
|
193
|
+
|
|
|
194
|
+/*
|
|
|
195
|
+* Remove COMMENTS in its entirety
|
|
|
196
|
+*/
|
|
|
197
|
+// Removes COMMENTS from admin menu
|
|
|
198
|
+add_action( 'admin_menu', 'remove_admin_menus' );
|
|
|
199
|
+function remove_admin_menus() {
|
|
|
200
|
+ remove_menu_page( 'edit-comments.php' );
|
|
|
201
|
+}
|
|
|
202
|
+// Removes COMMENTS from post and pages
|
|
|
203
|
+add_action('init', 'remove_comment_support', 100);
|
|
|
204
|
+function remove_comment_support() {
|
|
|
205
|
+ remove_post_type_support( 'post', 'comments' );
|
|
|
206
|
+ remove_post_type_support( 'page', 'comments' );
|
|
|
207
|
+}
|
|
|
208
|
+// Removes COMMENTS from admin bar
|
|
|
209
|
+add_action( 'wp_before_admin_bar_render', 'remove_comments_admin_bar' );
|
|
|
210
|
+function remove_comments_admin_bar() {
|
|
|
211
|
+ global $wp_admin_bar;
|
|
|
212
|
+ $wp_admin_bar->remove_menu('comments');
|
|
|
213
|
+}
|
|
|
214
|
+
|
|
|
215
|
+/*
|
|
|
216
|
+* ADMIN CUSTOM COLUMNS
|
|
|
217
|
+*/
|
|
173
|
218
|
// Add the custom columns for ARTIST:
|
|
174
|
219
|
add_filter( 'manage_artist_posts_columns', 'set_custom_edit_artist_columns' );
|
|
175
|
220
|
function set_custom_edit_artist_columns($columns) {
|
|
|
@@ -211,7 +256,7 @@ add_action( 'manage_event_posts_custom_column' , 'custom_event_column', 10, 2 );
|
|
211
|
256
|
function custom_event_column( $column, $post_id ) {
|
|
212
|
257
|
switch ( $column ) {
|
|
213
|
258
|
case 'event_type' :
|
|
214
|
|
- $terms = get_the_term_list( $post_id , 'event_type' , '' , ',' , '' );
|
|
|
259
|
+ $terms = get_the_term_list( $post_id , 'event_type' , '' , ', ' , '' );
|
|
215
|
260
|
echo is_string( $terms ) ? $terms : '—';
|
|
216
|
261
|
break;
|
|
217
|
262
|
}
|
|
|
@@ -231,7 +276,7 @@ add_action( 'manage_short_posts_custom_column' , 'custom_short_column', 10, 2 );
|
|
231
|
276
|
function custom_short_column( $column, $post_id ) {
|
|
232
|
277
|
switch ( $column ) {
|
|
233
|
278
|
case 'material' :
|
|
234
|
|
- $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
|
|
|
279
|
+ $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
|
|
235
|
280
|
echo is_string( $terms ) ? $terms : '—';
|
|
236
|
281
|
break;
|
|
237
|
282
|
}
|
|
|
@@ -251,7 +296,7 @@ add_action( 'manage_technique_posts_custom_column' , 'custom_technique_column',
|
|
251
|
296
|
function custom_technique_column( $column, $post_id ) {
|
|
252
|
297
|
switch ( $column ) {
|
|
253
|
298
|
case 'material' :
|
|
254
|
|
- $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
|
|
|
299
|
+ $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
|
|
255
|
300
|
echo is_string( $terms ) ? $terms : '—';
|
|
256
|
301
|
break;
|
|
257
|
302
|
}
|
|
|
@@ -271,7 +316,7 @@ add_action( 'manage_guide_posts_custom_column' , 'custom_guide_column', 10, 2 );
|
|
271
|
316
|
function custom_guide_column( $column, $post_id ) {
|
|
272
|
317
|
switch ( $column ) {
|
|
273
|
318
|
case 'material' :
|
|
274
|
|
- $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
|
|
|
319
|
+ $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
|
|
275
|
320
|
echo is_string( $terms ) ? $terms : '—';
|
|
276
|
321
|
break;
|
|
277
|
322
|
}
|
|
|
@@ -291,7 +336,7 @@ add_action( 'manage_object_posts_custom_column' , 'custom_object_column', 10, 2
|
|
291
|
336
|
function custom_object_column( $column, $post_id ) {
|
|
292
|
337
|
switch ( $column ) {
|
|
293
|
338
|
case 'material' :
|
|
294
|
|
- $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
|
|
|
339
|
+ $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
|
|
295
|
340
|
echo is_string( $terms ) ? $terms : '—';
|
|
296
|
341
|
break;
|
|
297
|
342
|
}
|
|
|
@@ -311,7 +356,7 @@ add_action( 'manage_guide_posts_custom_column' , 'custom_publication_column', 10
|
|
311
|
356
|
function custom_publication_column( $column, $post_id ) {
|
|
312
|
357
|
switch ( $column ) {
|
|
313
|
358
|
case 'material' :
|
|
314
|
|
- $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
|
|
|
359
|
+ $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
|
|
315
|
360
|
echo is_string( $terms ) ? $terms : '—';
|
|
316
|
361
|
break;
|
|
317
|
362
|
}
|