Skip to content

Commit

Permalink
v1.0.6
Browse files Browse the repository at this point in the history
fix(post): Actually fix post type registration
  • Loading branch information
Log1x committed Mar 31, 2020
1 parent 8232529 commit 737c5f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.0.6 (03/31/20)

- fix(post): Actually fix post type registration

## v1.0.5 (03/31/20)

- fix(post): Fix post type registration
Expand Down
12 changes: 5 additions & 7 deletions src/Poet.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($config = [])
protected function registerPosts()
{
$this->config->only('post')->each(function ($post) {
foreach ($post as $key => $value) {
return collect($post)->each(function ($value, $key) {
if (empty($key)) {
return register_extended_post_type(...Arr::wrap($value));
}
Expand All @@ -56,12 +56,10 @@ protected function registerPosts()

return register_extended_post_type(
$key,
Arr::wrap(
Arr::get($value, 'links', 'post')
),
$value,
Arr::get($value, 'labels', [])
);
}
});
});
}

Expand All @@ -77,7 +75,7 @@ protected function registerPosts()
protected function registerTaxonomies()
{
$this->config->only('taxonomy')->each(function ($taxonomy) {
foreach ($taxonomy as $key => $value) {
return collect($taxonomy)->each(function ($value, $key) {
if (empty($key)) {
return register_extended_taxonomy($value, 'post');
}
Expand All @@ -92,7 +90,7 @@ protected function registerTaxonomies()
$value,
Arr::get($value, 'labels', [])
);
}
});
});
}

Expand Down

0 comments on commit 737c5f6

Please # to comment.