Skip to content

Commit

Permalink
Merge pull request #5 from rosswintle/master
Browse files Browse the repository at this point in the history
Fixes issue #3 incorrect JSON key when exporting pages
  • Loading branch information
jackmcdade committed May 2, 2019
2 parents 0e9ffe0 + 374fe46 commit 830e244
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ private function setPosts($type = 'post')
'content' => wpautop($post->post_content),
'author' => $author,
),
'categories' => array_map(function ($category) {
return $category->slug;
}, get_the_category($post->ID)),
'categories' => wp_list_pluck(get_the_category($post->ID), 'slug'),
'tags' => wp_list_pluck(get_the_tags($post->ID), 'slug'),
);

foreach ($this->metadata('post', $post) as $key => $meta) {
Expand All @@ -90,7 +89,7 @@ private function setPages()
'order' => $page->menu_order,
'data' => array(
'title' => $page->post_title,
'post_content' => $page->post_content,
'content' => $page->post_content,
),
);

Expand Down

0 comments on commit 830e244

Please sign in to comment.