Skip to content

Commit f22783d

Browse files
authored
Merge pull request #157 from stellarwp/fix/dont-register-alternate-submenu-when-no-premium-plugins-active
Don't register alternate submenu when no premium plugins are active
2 parents c9519c3 + fa3825e commit f22783d

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

changelog.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
### [1.2.0] 2026-05-13
22

3+
* Feature - The features page no longer shows unless a Premium Addon has been registered.
4+
* Tweak - Added the `lw_harbor/loaded` action to indicate when Harbor is loaded.
35
* Tweak - Added the `lw_harbor/premium_plugin_exists` filter to declare whether a premium plugin exists on a site.
46
* Tweak - Removed opt-in as it will not be necessary now that external communications are gated behind a Premium Addon enabling Harbor.
5-
* Tweak - Added the `lw_harbor/loaded` action to indicate when Harbor is loaded.
6-
* Feature - The features page no longer shows unless a Premium Addon has been registered.
7+
* Tweak - The `lw-harbor/hide_menu_item` now also applies to the submenu item created by `lw_harbor_register_submenu()`.
78

89
### [1.1.0] 2026-05-12
910

src/Harbor/API/Functions/Actions/Register_Submenu.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ class Register_Submenu {
1515
* @return void
1616
*/
1717
public function __invoke( string $parent_slug ): void {
18+
if (
19+
! did_action( 'lw_harbor/loaded' )
20+
/** This filter is documented in src/Harbor/Admin/Feature_Manager_Page.php */
21+
|| apply_filters( 'lw-harbor/hide_menu_item', false )
22+
) {
23+
return;
24+
}
25+
1826
add_action(
1927
'admin_menu',
2028
static function () use ( $parent_slug ): void {

0 commit comments

Comments
 (0)