elementor_batch = new Wpfnl_Elementor_Batch(); } if ( 'gutenberg' === $page_builder ) { $this->gutenberg_batch = new Wpfnl_Gutenberg_Batch(); } if ( 'divi-builder' === $page_builder ) { $this->divi_batch = Wpfnl_functions::is_divi5_active() ? new Wpfnl_Divi5_Batch() : new Wpfnl_Divi_Batch(); } if ( 'bricks' === $page_builder ) { $this->bricks_batch = new Wpfnl_Bricks_Batch(); } add_action( 'wpfunnels_after_step_import', array( $this, 'start_processing' ), 10, 2 ); } /** * Start the batch import process * * @param int $step_id funnel step id. * @param string $builder active page builder. * * @since 1.0.0 */ public function start_processing( $step_id = 0, $builder = 'elementor' ) { if ( $step_id && !Wpfnl_functions::maybe_duplicate_step( $step_id ) ) { if ( 'elementor' === $builder && class_exists( '\Elementor\Plugin' ) ) { $this->elementor_batch->push_to_queue( $step_id ); $this->elementor_batch->save()->dispatch(); } if ( 'gutenberg' === $builder ) { $this->gutenberg_batch->push_to_queue( $step_id ); $this->gutenberg_batch->save()->dispatch(); } if ( 'divi-builder' === $builder ) { $this->divi_batch->push_to_queue( $step_id ); $this->divi_batch->save()->dispatch(); } if ( 'bricks' === $builder ) { $this->bricks_batch->push_to_queue( $step_id ); $this->bricks_batch->save()->dispatch(); } } } }