소스 검색

add author support to other post_types

tags/1.0.2
Alej 3 년 전
부모
커밋
f54c034bbf
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17
    0
      vue-theme/functions.php

+ 17
- 0
vue-theme/functions.php 파일 보기

@@ -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' );

Loading…
취소
저장