| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Helpers; |
| 4 |
|
| 5 |
/** |
| 6 |
* This class use to register script. |
| 7 |
* This class internally uses asset information to set script dependencies and version generated by @wordpress/dependency-extraction-webpack-plugin package. |
| 8 |
* It also handles script translation registration. |
| 9 |
* |
| 10 |
* @since 2.19.6 |
| 11 |
*/ |
| 12 |
class EnqueueScript |
| 13 |
{ |
| 14 |
/** |
| 15 |
* @since 2.19.6 |
| 16 |
* |
| 17 |
* @param string $scriptId |
| 18 |
* @param string $scriptPath |
| 19 |
* |
| 20 |
* @return \Give\Framework\EnqueueScript |
| 21 |
*/ |
| 22 |
public static function make($scriptId, $scriptPath) |
| 23 |
{ |
| 24 |
return new \Give\Framework\EnqueueScript( |
| 25 |
$scriptId, |
| 26 |
$scriptPath, |
| 27 |
GIVE_PLUGIN_DIR, |
| 28 |
GIVE_PLUGIN_URL, |
| 29 |
'give' |
| 30 |
); |
| 31 |
} |
| 32 |
} |
| 33 |
|