it looks like the problem is that there is not too section in network admin so you need to add it to the settings
public function run(): void {
if ( is_multisite() ) {
add_action( 'network_admin_menu', \Closure::fromCallable( [ $this, 'network_register_menu' ] ) );
} else {
add_action( 'admin_menu', \Closure::fromCallable( [ $this, 'register_menu' ] ) );
}
add_action( 'admin_enqueue_scripts', \Closure::fromCallable( [ $this, 'enqueue' ] ) );
}
private function register_menu(): void {
add_management_page(
__( 'WP Mail Debugger' ),
__( 'WP Mail Debugger' ),
'manage_options',
'wp-mail-debugger',
\Closure::fromCallable( [ $this, 'render' ] )
);
}
private function network_register_menu(): void {
add_submenu_page( 'settings.php',
__( 'WP Mail Debugger' ),
__( 'WP Mail Debugger' ),
'manage_options',
'wp-mail-debugger',
\Closure::fromCallable( [ $this, 'render' ] )
);
}
I also had to add the network setting page to the script loader
private function enqueue(): void {
if ( get_current_screen()->id === 'tools_page_wp-mail-debugger' || get_current_screen()->id === 'settings_page_wp-mail-debugger-network' ) {
$this->asset_manager->enqueue( 'admin-page' );
}
}
Thanks for reporting this @pbearne! This will be fixed in a release in the next week or two.
If you’re interested in testing, I’ve pushed some changes to Github. A network admin and regular admin view is now supported.
I will install this for my client
thanks
Hi @pbearne,
This has now been released in version 1.0.