Recast. */ final class Menu { const SLUG = 'recast'; /** * Page hook suffix, set on registration. * * @var string */ private static $hook = ''; /** * Hooks registration. * * @return void */ public static function register() { add_action( 'admin_menu', array( __CLASS__, 'add_menu' ), 60 ); } /** * Adds the submenu page. * * @return void */ public static function add_menu() { self::$hook = (string) add_submenu_page( 'woocommerce', __( 'Recast Subscriptions', 'recast-subscriptions' ), __( 'Recast', 'recast-subscriptions' ), Auth::read_capability(), self::SLUG, array( Page::class, 'render' ) ); Shell::register_for_hook( self::$hook ); } /** * Hook suffix of the Recast page. * * @return string */ public static function hook() { return self::$hook; } /** * URL of the Recast page. * * @param string $route Hash route, e.g. '#/journal'. * @return string */ public static function url( $route = '' ) { return admin_url( 'admin.php?page=' . self::SLUG ) . $route; } }