Skip to content

Commit

Permalink
enhance(admin-menu): Allow post types to be moved to tools (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelo2605 authored Jul 28, 2023
1 parent 0db825a commit c45cb13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Modules/AdminMenuModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public function handle()
{
add_filter('admin_menu', function () {
$this->config = $this->config->mapWithKeys(function ($value, $key) {
$page = admin_url("admin.php?page={$value}");
$url = post_type_exists($value) ? "edit.php?post_type={$value}" : "admin.php?page={$value}";
$page = admin_url($url);

return is_int($key) ? [$value => $page] : [$key => $page];
});
Expand Down

0 comments on commit c45cb13

Please sign in to comment.