ソースを参照

:bug: adding feature images even if no related parent_id

tags/0.9.0
j 4年前
コミット
bb764c4cc6
1個のファイルの変更4行の追加1行の削除
  1. 4
    1
      plugins/cia-endpoints/includes/formats.php

+ 4
- 1
plugins/cia-endpoints/includes/formats.php ファイルの表示

@@ -22,7 +22,10 @@ function default_post_format( $item, $include_content ) {
22 22
     if($include_content) $filtered[content] = $item->post_content;
23 23
 
24 24
     $filtered[featured] = get_the_post_thumbnail_url($item);
25
-
25
+    if(!$filtered[featured]) {
26
+        $thumbnailId = get_post_meta( $item->ID, '_thumbnail_id', true );
27
+        $filtered[featured] = get_post($thumbnailId)->guid;
28
+    }
26 29
 
27 30
     // Materials + type endpoints
28 31
     // if($item->post_type === 'artist' || $item->post_type === 'event' || $item->post_type === 'exhibition') {

読み込み中…
キャンセル
保存