Support » Plugin: WP Mail Debugger » does this work on Multi site?

  • Resolved Paul Bearne

    (@pbearne)


    Not seeing a link in tools and get a “Sorry, you are not allowed to access this page.” message if open the page directly

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Paul Bearne

    (@pbearne)

    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' ] )
            );
        }
    Thread Starter Paul Bearne

    (@pbearne)

    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' );
    		}
    	} 
    Plugin Author Timothy Jacobs

    (@timothyblynjacobs)

    Thanks for reporting this @pbearne! This will be fixed in a release in the next week or two.

    Plugin Author Timothy Jacobs

    (@timothyblynjacobs)

    If you’re interested in testing, I’ve pushed some changes to Github. A network admin and regular admin view is now supported.

    Thread Starter Paul Bearne

    (@pbearne)

    I will install this for my client

    thanks

    Plugin Author Timothy Jacobs

    (@timothyblynjacobs)

    Hi @pbearne,

    This has now been released in version 1.0.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘does this work on Multi site?’ is closed to new replies.