<?php

namespace _121Digital\Connect\Network;

class NetworkViewSite
{
    public function register(): void
    {
        add_action('load-site-info.php', [$this, 'redirectToCustomEditSitePage']);
        add_action('network_menu', [$this, 'registerCustomEditSitePage']);
    }

    public function redirectToCustomEditSitePage(): void
    {
        wp_redirect(network_admin_url('admin.php?page=custom-view-site&site_id=' . absint($_GET['id'])));
        exit;
    }
}
