소스 검색

remove comment from admin, category column styling

tags/0.9.0
Alej 4 년 전
부모
커밋
17b23b1f92
1개의 변경된 파일52개의 추가작업 그리고 7개의 파일을 삭제
  1. 52
    7
      vue-theme/functions.php

+ 52
- 7
vue-theme/functions.php 파일 보기

169
 add_theme_support('editor-styles');
169
 add_theme_support('editor-styles');
170
 add_editor_style( 'editor-style.css' );
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
 // Add the custom columns for ARTIST:
218
 // Add the custom columns for ARTIST:
174
 add_filter( 'manage_artist_posts_columns', 'set_custom_edit_artist_columns' );
219
 add_filter( 'manage_artist_posts_columns', 'set_custom_edit_artist_columns' );
175
 function set_custom_edit_artist_columns($columns) {
220
 function set_custom_edit_artist_columns($columns) {
211
 function custom_event_column( $column, $post_id ) {
256
 function custom_event_column( $column, $post_id ) {
212
     switch ( $column ) {
257
     switch ( $column ) {
213
         case 'event_type' :
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
             echo is_string( $terms ) ? $terms : '—';
260
             echo is_string( $terms ) ? $terms : '—';
216
             break;
261
             break;
217
     }
262
     }
231
 function custom_short_column( $column, $post_id ) {
276
 function custom_short_column( $column, $post_id ) {
232
     switch ( $column ) {
277
     switch ( $column ) {
233
         case 'material' :
278
         case 'material' :
234
-            $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
279
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
235
             echo is_string( $terms ) ? $terms : '—';
280
             echo is_string( $terms ) ? $terms : '—';
236
             break;
281
             break;
237
     }
282
     }
251
 function custom_technique_column( $column, $post_id ) {
296
 function custom_technique_column( $column, $post_id ) {
252
     switch ( $column ) {
297
     switch ( $column ) {
253
         case 'material' :
298
         case 'material' :
254
-            $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
299
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
255
             echo is_string( $terms ) ? $terms : '—';
300
             echo is_string( $terms ) ? $terms : '—';
256
             break;
301
             break;
257
     }
302
     }
271
 function custom_guide_column( $column, $post_id ) {
316
 function custom_guide_column( $column, $post_id ) {
272
     switch ( $column ) {
317
     switch ( $column ) {
273
         case 'material' :
318
         case 'material' :
274
-            $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
319
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
275
             echo is_string( $terms ) ? $terms : '—';
320
             echo is_string( $terms ) ? $terms : '—';
276
             break;
321
             break;
277
     }
322
     }
291
 function custom_object_column( $column, $post_id ) {
336
 function custom_object_column( $column, $post_id ) {
292
     switch ( $column ) {
337
     switch ( $column ) {
293
         case 'material' :
338
         case 'material' :
294
-            $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
339
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
295
             echo is_string( $terms ) ? $terms : '—';
340
             echo is_string( $terms ) ? $terms : '—';
296
             break;
341
             break;
297
     }
342
     }
311
 function custom_publication_column( $column, $post_id ) {
356
 function custom_publication_column( $column, $post_id ) {
312
     switch ( $column ) {
357
     switch ( $column ) {
313
         case 'material' :
358
         case 'material' :
314
-            $terms = get_the_term_list( $post_id , 'material' , '' , ',' , '' );
359
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
315
             echo is_string( $terms ) ? $terms : '—';
360
             echo is_string( $terms ) ? $terms : '—';
316
             break;
361
             break;
317
     }
362
     }

Loading…
취소
저장