| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\Campaigns\Actions; |
| 4 |
|
| 5 |
use Give\API\REST\V3\Routes\Campaigns\ValueObjects\CampaignRoute; |
| 6 |
|
| 7 |
/** |
| 8 |
* The purpose of this action is to have a centralized place for localizing options used on frontend |
| 9 |
* by campaign scripts (blocks, etc.) |
| 10 |
* |
| 11 |
* @since 4.6.1 |
| 12 |
*/ |
| 13 |
class LoadCampaignPublicOptions |
| 14 |
{ |
| 15 |
public function __invoke() |
| 16 |
{ |
| 17 |
wp_register_script('give-campaign-options', false); |
| 18 |
|
| 19 |
wp_localize_script('give-campaign-options', 'GiveCampaignOptions', |
| 20 |
[ |
| 21 |
'isAdmin' => false, |
| 22 |
'currency' => give_get_currency(), |
| 23 |
] |
| 24 |
); |
| 25 |
|
| 26 |
wp_enqueue_script('give-campaign-options'); |
| 27 |
} |
| 28 |
} |
| 29 |
|