Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
Fixes for older config schemas and PHP 7.4 deprecations.
  • Loading branch information
kellymears authored May 23, 2020
1 parent a2a70be commit 58845ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.1.2 (05/22/20)

- fix(config): Allow for undefined configuration keys.
- fix(poet): Fix deprecated unparenthesized ternaries (PHP 7.4)

## v1.1.1 (05/15/20)

- feat(post): Add support for automatically adding heading anchor ID attributes to post types.
Expand Down
18 changes: 9 additions & 9 deletions src/Poet.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public function __construct($config = [])
$this->config = collect($config)->mapInto(Collection::class);

add_filter('init', function () {
$this->registerPosts();
$this->registerAnchors();
$this->registerTaxonomies();
$this->registerBlocks();
$this->registerCategories();
$this->registerPalette();
$this->registerMenu();
$this->config->has('post') && $this->registerPosts();
$this->config->has('post') && $this->registerAnchors();
$this->config->has('taxonomy') && $this->registerTaxonomies();
$this->config->has('block') && $this->registerBlocks();
$this->config->has('categories') && $this->registerCategories();
$this->config->has('palette') && $this->registerPalette();
$this->config->has('menu') && $this->registerMenu();
}, 20);
}

Expand Down Expand Up @@ -339,8 +339,8 @@ protected function registerMenu()
$GLOBALS['submenu']['tools.php'],
collect($item)->slice(0, 2)->push(
admin_url(
is_string($menu->get($item[2])) ? $item[2] :
Str::contains($item[2], '.php') ? $item[2] : Str::start($item[2], 'admin.php?page=')
(is_string($menu->get($item[2])) ? $item[2] : Str::contains($item[2], '.php'))
? $item[2] : Str::start($item[2], 'admin.php?page=')
)
)->all()
);
Expand Down

0 comments on commit 58845ee

Please sign in to comment.