diff --git a/core/basepage.php b/core/basepage.php index c016f375c..dbf730fd6 100644 --- a/core/basepage.php +++ b/core/basepage.php @@ -511,8 +511,9 @@ protected function get_nav_links(): array } $sub_links = $sub_links ?? []; - usort($nav_links, "Shimmie2\sort_nav_links"); - usort($sub_links, "Shimmie2\sort_nav_links"); + + usort($nav_links, fn (NavLink $a, NavLink $b) => $a->order - $b->order); + usort($sub_links, fn (NavLink $a, NavLink $b) => $a->order - $b->order); return [$nav_links, $sub_links]; } @@ -705,8 +706,3 @@ public static function is_active(array $pages_matched, string $url = null): bool return false; } } - -function sort_nav_links(NavLink $a, NavLink $b): int -{ - return $a->order - $b->order; -} diff --git a/core/user.php b/core/user.php index 521e35f26..8dc8c1309 100644 --- a/core/user.php +++ b/core/user.php @@ -11,12 +11,6 @@ use function MicroHTML\INPUT; -function _new_user(array $row): User -{ - return new User($row); -} - - /** * Class User *