_response = WOODMART_Registry::getInstance()->ajaxresponse; $saved_builder = get_option( 'woodmart_base_import_builder', 'none' ); if( $saved_builder == 'none' ) { $this->_builder = woodmart_get_opt( 'page_builder', 'wpb' ); } else { $this->_builder = $saved_builder; } $this->_woodmart_versions = woodmart_get_config( 'versions' ); if ( 'elementor' === $this->_builder ) { $versions = woodmart_get_config( 'versions' ); foreach ( $versions as $key => $value ) { if ( isset( $value['elementor'] ) && ! $value['elementor'] ) { unset( $versions[ $key ] ); } } $this->_woodmart_versions = $versions; } add_action( 'wp_ajax_woodmart_import_data', array( $this, 'import_action' ) ); if( isset( $_GET['clean_data'] ) ) $this->clean_imported_version_data(); if( isset( $_GET['clean_attr'] ) ) $this->clean_import_attributes_data(); } public function get_builder() { return $this->_builder; } public function admin_import_screen( $type = false ) { $btn_label = esc_html__( 'Import page', 'woodmart' ); $activate_label = ''; $shop_page = get_option( 'woocommerce_shop_page_id' ); $builder = true; if ( woodmart_woocommerce_installed() ) { $this->import_attributes(); } ?>
admin_import_screen( 'base' ); } public function versions_import_screen() { $this->admin_import_screen( 'version' ); } public function pages_import_screen() { $this->admin_import_screen( 'page' ); } public function elements_import_screen() { $this->admin_import_screen( 'element' ); } public function shops_import_screen() { $this->admin_import_screen( 'shop' ); } public function products_import_screen() { $this->admin_import_screen( 'product' ); } public function versions_select( $type = false ) { $first_version = 'base'; $list = $this->_woodmart_versions; if( $type ) { $list = array_filter( $this->_woodmart_versions, function( $el ) use($type) { return $type == $el['type']; }); ksort( $list ); // reset($array); $first_version = key($list); } $this->page_preview( $first_version ); $list = array_reverse($list); ksort( $list ); ?>