| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function enqueueScripts(): void |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * Control whether to load the data attribute tracking script. |
||
| 30 | * |
||
| 31 | * @param bool $isEnabled |
||
| 32 | */ |
||
| 33 | $isEnabled = apply_filters('helick_gtm_enable_event_tracking', true); |
||
| 34 | |||
| 35 | if (!$isEnabled) { |
||
| 36 | return; |
||
| 37 | } |
||
| 38 | |||
| 39 | wp_enqueue_script( |
||
| 40 | 'helick-gtm-event-tracking', |
||
| 41 | plugin_dir_url(dirname(__FILE__)) . 'resources/js/event-tracking.js', |
||
| 42 | [], |
||
| 43 | filemtime(plugin_dir_path(dirname(__FILE__)) . 'resources/js/event-tracking.js'), |
||
| 44 | true |
||
| 45 | ); |
||
| 48 |