From d9f4ce3b731c6df3059634ee79f045e14d9b7ef5 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Tue, 16 Dec 2025 20:20:15 +0100 Subject: [PATCH 1/3] When we're acting as a host, move the menu item to position 0 --- classes/admin/class-page.php | 3 ++- classes/ui/class-branding.php | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/classes/admin/class-page.php b/classes/admin/class-page.php index f5f36fc302..57793818f0 100644 --- a/classes/admin/class-page.php +++ b/classes/admin/class-page.php @@ -104,7 +104,8 @@ public function add_page() { 'manage_options', $page_identifier, '__return_empty_string', - \progress_planner()->get_ui__branding()->get_admin_menu_icon() + \progress_planner()->get_ui__branding()->get_admin_menu_icon(), + \progress_planner()->get_ui__branding()->get_admin_submenu_position() ); \add_submenu_page( diff --git a/classes/ui/class-branding.php b/classes/ui/class-branding.php index a7fdc6e9df..ce86a855bf 100644 --- a/classes/ui/class-branding.php +++ b/classes/ui/class-branding.php @@ -176,6 +176,19 @@ public function get_admin_submenu_name(): string { : $this->get_api_data()['admin_submenu_name']; } + /** + * Get the admin-submenu position. + * + * @return string + */ + public function get_admin_submenu_position(): string { + if ( $this->get_branding_id() !== 0 && $this->get_branding_id() !== 4958 ) { + return '-1000'; + } + + return ''; + } + /** * Get the Ravi name. * From e2f692fec7c6ecc7924171ebf3c52bc06dd66452 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Tue, 16 Dec 2025 20:24:58 +0100 Subject: [PATCH 2/3] Saving helps --- classes/ui/class-branding.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/ui/class-branding.php b/classes/ui/class-branding.php index ce86a855bf..0c6517bb9e 100644 --- a/classes/ui/class-branding.php +++ b/classes/ui/class-branding.php @@ -179,14 +179,14 @@ public function get_admin_submenu_name(): string { /** * Get the admin-submenu position. * - * @return string + * @return int|null */ - public function get_admin_submenu_position(): string { + public function get_admin_submenu_position(): int|null { if ( $this->get_branding_id() !== 0 && $this->get_branding_id() !== 4958 ) { - return '-1000'; + return -1000; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison } - return ''; + return null; } /** From 1c6684b83393138d8f6d42a101e10310cb14eb8f Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Tue, 16 Dec 2025 20:27:46 +0100 Subject: [PATCH 3/3] Fix PHP 7.4 linting issue --- classes/ui/class-branding.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/ui/class-branding.php b/classes/ui/class-branding.php index 0c6517bb9e..fc9041758e 100644 --- a/classes/ui/class-branding.php +++ b/classes/ui/class-branding.php @@ -181,9 +181,9 @@ public function get_admin_submenu_name(): string { * * @return int|null */ - public function get_admin_submenu_position(): int|null { + public function get_admin_submenu_position(): mixed { if ( $this->get_branding_id() !== 0 && $this->get_branding_id() !== 4958 ) { - return -1000; // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison + return -1000; } return null;