PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.1.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.1.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / classes / importer / batch-process / class-cartflows-change-template-batch.php

class-cartflows-change-template-batch.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.1.0, at classes/importer/batch-process/class-cartflows-change-template-batch.php

66 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Change Template Process
4 *
5 * @package CartFlows
6 * @since 1.2.2
7 */
8
9 // Exit if accessed directly.
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13 if ( ! class_exists( 'Cartflows_Change_Template_Batch' ) && class_exists( 'WP_Background_Process' ) ) :
14
15 /**
16 * Change Template Process
17 *
18 * @since 1.2.2
19 */
20 class Cartflows_Change_Template_Batch extends WP_Background_Process {
21
22 /**
23 * Template Process
24 *
25 * @var string
26 */
27 protected $action = 'cartflows_change_template_process';
28
29 /**
30 * Task
31 *
32 * Override this method to perform any actions required on each
33 * queue item. Return the modified item for further processing
34 * in the next pass through. Or, return false to remove the
35 * item from the queue.
36 *
37 * @param mixed $post_id Queue item to iterate over.
38 *
39 * @return mixed
40 */
41 protected function task( $post_id ) {
42
43 wcf()->logger->log( '(✓) Step ID ' . $post_id );
44 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
45 wcf()->logger->sync_log( 'Processed:' . $post_id );
46 }
47 update_post_meta( $post_id, '_wp_page_template', 'cartflows-default' );
48 return false;
49 }
50
51 /**
52 * Complete
53 *
54 * Override if applicable, but ensure that the below actions are
55 * performed, or, call parent::complete().
56 */
57 protected function complete() {
58 parent::complete();
59 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
60 wcf()->logger->sync_log( 'Process Complete' );
61 }
62 }
63 }
64
65 endif;
66