| 1 |
<?php |
| 2 |
/** |
| 3 |
* Image Background Process |
| 4 |
* |
| 5 |
* @package CartFlows |
| 6 |
* @since 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( class_exists( 'WP_Background_Process' ) ) : |
| 10 |
|
| 11 |
/** |
| 12 |
* Image Background Process |
| 13 |
* |
| 14 |
* @since 1.0.0 |
| 15 |
*/ |
| 16 |
class CartFlows_Batch_Process_Elementor extends WP_Background_Process { |
| 17 |
|
| 18 |
/** |
| 19 |
* Image Process |
| 20 |
* |
| 21 |
* @var string |
| 22 |
*/ |
| 23 |
protected $action = 'cartflows_elementor_image_process'; |
| 24 |
|
| 25 |
/** |
| 26 |
* Task |
| 27 |
* |
| 28 |
* Override this method to perform any actions required on each |
| 29 |
* queue item. Return the modified item for further processing |
| 30 |
* in the next pass through. Or, return false to remove the |
| 31 |
* item from the queue. |
| 32 |
* |
| 33 |
* @since 1.0.0 |
| 34 |
* |
| 35 |
* @param integer $post_id Post Id. |
| 36 |
* @return mixed |
| 37 |
*/ |
| 38 |
protected function task( $post_id ) { |
| 39 |
|
| 40 |
$obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor(); |
| 41 |
$obj->import_single_template( $post_id ); |
| 42 |
|
| 43 |
return false; |
| 44 |
} |
| 45 |
|
| 46 |
/** |
| 47 |
* Complete |
| 48 |
* |
| 49 |
* Override if applicable, but ensure that the below actions are |
| 50 |
* performed, or, call parent::complete(). |
| 51 |
* |
| 52 |
* @since 1.0.0 |
| 53 |
*/ |
| 54 |
protected function complete() { |
| 55 |
|
| 56 |
parent::complete(); |
| 57 |
|
| 58 |
do_action( 'cartflows_import_complete' ); |
| 59 |
|
| 60 |
} |
| 61 |
|
| 62 |
} |
| 63 |
|
| 64 |
endif; |
| 65 |
|