| 1 |
<?php |
| 2 |
|
| 3 |
namespace AgeGate\Presentation; |
| 4 |
|
| 5 |
use AgeGate\Common\Settings; |
| 6 |
|
| 7 |
class Interaction |
| 8 |
{ |
| 9 |
public function __construct() |
| 10 |
{ |
| 11 |
add_action('wp_enqueue_scripts', [$this, 'assets'], 1); |
| 12 |
} |
| 13 |
|
| 14 |
public function assets() |
| 15 |
{ |
| 16 |
$settings = Settings::getInstance(); |
| 17 |
$path = sprintf('%s%s%s', AGE_GATE_URL, 'dist', ($settings->rawAssets ? '/raw' : '')); |
| 18 |
wp_enqueue_script('age-gate-interaction', $path . '/interaction.js', [], AGE_GATE_VERSION, !$settings->inHeader); |
| 19 |
} |
| 20 |
} |
| 21 |
|