Start Wizard!

steps = array( 'basic-config' => array( 'name' => __( 'Welcome', 'cartflows' ), 'view' => array( $this, 'welcome_step' ), 'handler' => array( $this, 'welcome_step_save' ), ), 'page-builder' => array( 'name' => __( 'Page Builder', 'cartflows' ), 'view' => array( $this, 'page_builder_step' ), // 'handler' => array( $this, 'page_builder_step_save' ), ), 'setup-ready' => array( 'name' => __( 'Ready!', 'cartflows' ), 'view' => array( $this, 'ready_step' ), 'handler' => '', ), ); $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); wp_enqueue_style( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/css/setup-wizard.css', array( 'dashicons' ), CARTFLOWS_VER ); wp_style_add_data( 'cartflows-setup', 'rtl', 'replace' ); wp_enqueue_script( 'cartflows-setup', CARTFLOWS_URL . 'admin/assets/js/setup-wizard.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER ); wp_enqueue_media(); if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { call_user_func( $this->steps[ $this->step ]['handler'] ); } ob_start(); $this->setup_wizard_header(); $this->setup_wizard_steps(); $this->setup_wizard_content(); $this->setup_wizard_footer(); exit; } /** * Get current step slug */ public function get_current_step_slug() { $keys = array_keys( $this->steps ); return $keys[ array_search( $this->step, array_keys( $this->steps ) ) ]; } /** * Get previous step link */ public function get_prev_step_link() { $keys = array_keys( $this->steps ); return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ) ) - 1 ] ); } /** * Get next step link */ public function get_next_step_link() { $keys = array_keys( $this->steps ); return add_query_arg( 'step', $keys[ array_search( $this->step, array_keys( $this->steps ) ) + 1 ] ); } /** * Get next step link */ public function get_next_step_plain_link() { $keys = array_keys( $this->steps ); $step = $keys[ array_search( $this->step, array_keys( $this->steps ) ) + 1 ]; return admin_url( 'index.php?page=cartflow-setup&step=' . $step ); } /** * Setup Wizard Header. */ public function setup_wizard_header() { ?> <?php _e( 'CartFlows Setup', 'cartflows' ); ?>
steps; ?>
    $step ) : $classes = ''; $activated = false; if ( $step_key === $this->step ) { $classes = 'active'; $activated = true; } elseif ( array_search( $this->step, array_keys( $this->steps ) ) > array_search( $step_key, array_keys( $this->steps ) ) ) { $classes = 'done'; $activated = true; } ?>
'; call_user_func( $this->steps[ $this->step ]['view'] ); echo ''; } /** * Introduction step. */ public function welcome_step() { ?>

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

get_next_step_link(); wp_redirect( esc_url_raw( $redirect_url ) ); exit; } /** * Locale settings */ public function page_builder_step() { ?>

__( 'Elementor', 'cartflows' ), 'value' => 'elementor', 'data' => array( 'slug' => 'elementor', 'init' => 'elementor/elementor.php', 'active' => is_plugin_active( 'elementor/elementor.php' ) ? 'yes' : 'no', 'install' => isset( $installed_plugins['elementor/elementor.php'] ) ? 'yes' : 'no', ), ), ); ?>

false, 'message' => $activate->get_error_message(), ) ); } wp_send_json_success( $stored ); } /** * Get Location rules of schema for Custom meta box. * * @param array $enabled_on Enabled on rules. * @param array $exclude_from Exlcude on rules. * @return array */ public static function get_display_rules_for_meta_box( $enabled_on, $exclude_from ) { $locations = array(); $enabled_location = array(); $exclude_location = array(); $args = array( 'public' => true, '_builtin' => true, ); $post_types = get_post_types( $args ); unset( $post_types['attachment'] ); $args['_builtin'] = false; $custom_post_type = get_post_types( $args ); $post_types = array_merge( $post_types, $custom_post_type ); if ( ! empty( $enabled_on ) && isset( $enabled_on['rule'] ) ) { $enabled_location = $enabled_on['rule']; } if ( ! empty( $exclude_from ) && isset( $exclude_from['rule'] ) ) { $exclude_location = $exclude_from['rule']; } if ( in_array( 'specifics', $enabled_location ) || ( in_array( 'basic-singulars', $enabled_location ) && ! in_array( 'basic-singulars', $exclude_location ) ) ) { foreach ( $post_types as $post_type ) { $locations[ $post_type ] = 1; } } else { foreach ( $post_types as $post_type ) { $key = $post_type . '|all'; if ( in_array( $key, $enabled_location ) && ! in_array( $key, $exclude_location ) ) { $locations[ $post_type ] = 1; } } } return $locations; } /** * Final step. */ public function ready_step() { // Set setup wizard status to complete. update_option( 'wcf_setup_complete', true ); ?>