has_sdk = $has_sdk ?? static fn (): bool => function_exists( 'adaf_fs' ); } /** * Hook registration. After AdminPage's default priority, so the parent * menu exists. */ public function register(): void { add_action( 'admin_menu', array( $this, 'register_menu' ), 20 ); } /** * Add the submenu items, unless Freemius provides its own. */ public function register_menu(): void { if ( ( $this->has_sdk )() ) { return; } // Repeat the parent as the first item: otherwise WordPress makes the // first submenu item the parent's target, and the top-level // "Agent Firewall" link would leave the site. $title = __( 'Agent Firewall', 'agentic-daisy-ai-agent-firewall' ); add_submenu_page( AdminPage::SLUG, $title, $title, 'manage_options', AdminPage::SLUG ); $upgrade = __( 'Upgrade', 'agentic-daisy-ai-agent-firewall' ); add_submenu_page( AdminPage::SLUG, $upgrade, $upgrade, 'manage_options', self::PRICING_URL ); } }