| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Log; |
| 4 |
|
| 5 |
use Give\Log\ValueObjects\LogType; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class Assets |
| 9 |
* @package Give\Log\UserInterface |
| 10 |
* |
| 11 |
* @since 2.10.0 |
| 12 |
*/ |
| 13 |
class Assets { |
| 14 |
/** |
| 15 |
* Enqueue scripts |
| 16 |
*/ |
| 17 |
public function enqueueScripts() { |
| 18 |
wp_enqueue_script( |
| 19 |
'give-admin-log-list-table-app', |
| 20 |
GIVE_PLUGIN_URL . 'assets/dist/js/give-log-list-table-app.js', |
| 21 |
[ 'wp-element', 'wp-i18n' ], |
| 22 |
GIVE_VERSION, |
| 23 |
true |
| 24 |
); |
| 25 |
|
| 26 |
wp_localize_script( |
| 27 |
'give-admin-log-list-table-app', |
| 28 |
'GiveLogs', |
| 29 |
[ |
| 30 |
'apiRoot' => esc_url_raw( rest_url( 'give-api/v2/logs' ) ), |
| 31 |
'apiNonce' => wp_create_nonce( 'wp_rest' ), |
| 32 |
'logTypes' => LogType::getTypesTranslated(), |
| 33 |
] |
| 34 |
); |
| 35 |
} |
| 36 |
} |
| 37 |
|