| 1 |
<?php |
| 2 |
|
| 3 |
namespace Hostinger\Preview; |
| 4 |
|
| 5 |
use Hostinger\Helper; |
| 6 |
|
| 7 |
defined( 'ABSPATH' ) || exit; |
| 8 |
|
| 9 |
class Assets { |
| 10 |
public function __construct() { |
| 11 |
$helper = new Helper(); |
| 12 |
if ( $helper->is_preview_domain() ) { |
| 13 |
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_css' ) ); |
| 14 |
} |
| 15 |
} |
| 16 |
|
| 17 |
public function enqueue_preview_css(): void { |
| 18 |
if ( is_user_logged_in() ) { |
| 19 |
wp_enqueue_style( 'hostinger-preview-styles', HOSTINGER_ASSETS_URL . '/css/hts-preview.css', array(), HOSTINGER_VERSION ); |
| 20 |
} |
| 21 |
} |
| 22 |
} |
| 23 |
|