Przeglądaj źródła

add author support to other post_types

tags/1.0.2
Alej 3 lat temu
rodzic
commit
f54c034bbf
1 zmienionych plików z 17 dodań i 0 usunięć
  1. 17
    0
      vue-theme/functions.php

+ 17
- 0
vue-theme/functions.php Wyświetl plik

@@ -387,3 +387,20 @@ function custom_publication_column( $column, $post_id ) {
387 387
             break;
388 388
     }
389 389
 }
390
+// Add Author to Custom Post Type
391
+function add_author_support_to_posts() {
392
+    $args = array(
393
+       'public'   => true,
394
+       '_builtin' => false
395
+    );
396
+
397
+    $output = 'names';
398
+
399
+    $post_types = get_post_types( $args, $output ); 
400
+
401
+    foreach ( $post_types  as $post_type ) {
402
+        add_post_type_support( $post_type, 'author' );
403
+    }
404
+
405
+}
406
+add_action( 'init', 'add_author_support_to_posts' );

Ładowanie…
Anuluj
Zapisz