From eeb2130a1307215f7183e50377ced3fc3c4a8e4e Mon Sep 17 00:00:00 2001 From: Ike Sterzinger Date: Thu, 12 May 2022 09:32:30 +0200 Subject: [PATCH] add id and image fields to posts export --- Exporter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Exporter.php b/Exporter.php index b15095c..5eb7ac7 100644 --- a/Exporter.php +++ b/Exporter.php @@ -62,11 +62,13 @@ private function setPosts($type = 'post') $this->collections[$slug]["/{$slug}/" . $post->post_name] = array( 'order' => date("Y-m-d", strtotime($post->post_date)), 'data' => array( + 'id' => $post->ID, 'title' => $post->post_title, 'content' => wpautop($post->post_content), 'author' => $author, 'categories' => wp_list_pluck(get_the_category($post->ID), 'slug'), 'tags' => wp_list_pluck(get_the_tags($post->ID), 'slug'), + 'image' => wp_get_attachment_url( get_post_thumbnail_id($post->ID) ) ), );