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