浏览代码

:fire: removed extra arg | #148

tags/0.9.0
J 4 年前
父节点
当前提交
1aedc01204
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4
    8
      plugins/cia-endpoints/includes/formats.php

+ 4
- 8
plugins/cia-endpoints/includes/formats.php 查看文件

@@ -74,13 +74,12 @@ function default_post_format( $item, $include_content ) {
74 74
     return $filtered;
75 75
 }
76 76
 
77
-function minimal_post_format( $item, $include_excerpt ) {
77
+function minimal_post_format( $item ) {
78 78
     $filtered = [];
79 79
     $filtered[id] = $item->ID;
80 80
     $filtered[slug] = $item->post_name;
81 81
     $filtered[type] = $item->post_type;
82 82
     $filtered[title] = $item->post_title;
83
-    $filtered[date] = $item->post_date;
84 83
     
85 84
     $filtered[thumb] = get_the_post_thumbnail_url($item, 'medium');
86 85
     if(!$filtered[thumb]) {
@@ -92,14 +91,11 @@ function minimal_post_format( $item, $include_excerpt ) {
92 91
     // because they appear on the episode page
93 92
     $posts_with_excerpt = ['artist'];
94 93
     if( in_array($item->post_type, $posts_with_excerpt) ) {
95
-        $filtered[excerpt] = $item->post_excerpt;
96
-        if(!$filtered[excerpt]) {
97
-            $excerpt = get_the_excerpt($item);
98
-            $filtered[excerpt] = wp_specialchars_decode($excerpt);
99
-        }
94
+        $excerpt = get_the_excerpt($item);
95
+        $filtered[excerpt] = wp_specialchars_decode($excerpt);
100 96
     }
101 97
 
102
-    // Always include a date for date based types
98
+    // Always include a date for date based
103 99
     $posts_with_date = ['exhbition', 'event'];
104 100
     if( in_array($item->post_type, $posts_with_date) ) {
105 101
         $filtered[start] = get_post_meta($item->ID, $item->post_type . '-start-time', true);

正在加载...
取消
保存