PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / admin / import-export / batch-processing / divi-5 / class-wpfnl-divi5-batch.php

class-wpfnl-divi5-batch.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.3, at admin/import-export/batch-processing/divi-5/class-wpfnl-divi5-batch.php

46 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Divi 5 background import batch processor.
4 *
5 * Mirrors Wpfnl_Divi_Batch but uses the Divi 5 source class which handles
6 * JSON block content format instead of shortcode strings.
7 *
8 * @package WPFunnels\Batch
9 * @since 2.9.1
10 */
11
12 namespace WPFunnels\Batch;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 die( 'Direct access forbidden.' );
16 }
17
18 use WPFunnels\Batch\DiviV5\Wpfnl_Divi5_Source;
19
20 class Wpfnl_Divi5_Batch extends Wpfnl_Background_Task {
21
22 /** @var string Unique action key for the background queue. */
23 protected $action = 'wpfunnels_divi5_import_process';
24
25 /**
26 * Process a single import item.
27 *
28 * @param array{post_id: int, content: string|array} $item
29 * @return false Always return false to remove item from queue.
30 */
31 protected function task( $item ) {
32 $source = new Wpfnl_Divi5_Source();
33 $source->import_single_template(
34 (int) ( $item['post_id'] ?? 0 ),
35 $item['content'] ?? ''
36 );
37 return false;
38 }
39
40 /** @inheritDoc */
41 protected function complete() {
42 parent::complete();
43 do_action( 'wpfunnels/wpfnl_import_complete' );
44 }
45 }
46