Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 830e244

Browse files
authored
Merge pull request #5 from rosswintle/master
Fixes issue #3 incorrect JSON key when exporting pages
2 parents 0e9ffe0 + 374fe46 commit 830e244

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Exporter.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,8 @@ private function setPosts($type = 'post')
6666
'content' => wpautop($post->post_content),
6767
'author' => $author,
6868
),
69-
'categories' => array_map(function ($category) {
70-
return $category->slug;
71-
}, get_the_category($post->ID)),
69+
'categories' => wp_list_pluck(get_the_category($post->ID), 'slug'),
70+
'tags' => wp_list_pluck(get_the_tags($post->ID), 'slug'),
7271
);
7372

7473
foreach ($this->metadata('post', $post) as $key => $meta) {
@@ -90,7 +89,7 @@ private function setPages()
9089
'order' => $page->menu_order,
9190
'data' => array(
9291
'title' => $page->post_title,
93-
'post_content' => $page->post_content,
92+
'content' => $page->post_content,
9493
),
9594
);
9695

0 commit comments

Comments
 (0)