Modules
11 months ago
Form_Field.php
11 months ago
Form_Field_Option.php
1 year ago
Module_Refresh_Job.php
1 year ago
Overview.php
1 year ago
Sync_Module_Background_Job.php
1 year ago
WP_Options_Storage.php
1 year ago
Sync_Module_Background_Job.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Overview; |
| 4 | |
| 5 | use IAWP\Overview\Modules\Module; |
| 6 | use IAWP\Utils\Security; |
| 7 | use IAWP\Utils\WP_Async_Request; |
| 8 | /** @internal */ |
| 9 | class Sync_Module_Background_Job extends WP_Async_Request |
| 10 | { |
| 11 | protected $action = 'iawp_sync_module_background_job'; |
| 12 | protected function handle($data = []) |
| 13 | { |
| 14 | $ids = Security::array($data['ids']); |
| 15 | foreach ($ids as $id) { |
| 16 | $module = Module::get_saved_module($id); |
| 17 | // Unable to find a module to sync |
| 18 | if ($module === null) { |
| 19 | continue; |
| 20 | } |
| 21 | $module->refresh_dataset(); |
| 22 | } |
| 23 | } |
| 24 | } |
| 25 |