| 1 |
<?php |
| 2 |
|
| 3 |
namespace Hostinger; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
class ComingSoon { |
| 8 |
public function __construct() { |
| 9 |
add_action( 'wp_footer', array( $this, 'register_styles' ) ); |
| 10 |
add_action( 'template_redirect', array( $this, 'coming_soon' ) ); |
| 11 |
} |
| 12 |
|
| 13 |
public function coming_soon(): void { |
| 14 |
if ( ! is_user_logged_in() && ! is_admin() && ! current_user_can( 'update_plugins' ) ) { |
| 15 |
include_once HOSTINGER_ABSPATH . 'includes/Views/ComingSoon.php'; |
| 16 |
die; |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
public function register_styles(): void { |
| 21 |
wp_enqueue_style( 'hostinger_main_styles', HOSTINGER_ASSETS_URL . '/css/coming-soon.css', array(), HOSTINGER_VERSION ); |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
new ComingSoon(); |
| 26 |
|