PluginProbe
Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export / 2.12
Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export v2.12
3.0 2.24.2 2.24.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 2.0 2.0.1 2.1 2.1.1 2.1.2 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.16.1 2.16.2 All 96 releases
wp-ultimate-exporter / exportExtensions / JetEngine.php

JetEngine.php in Export All Posts, Products, Orders & Users | WP Ultimate Exporter | WordPress CSV Export 2.12, at exportExtensions/JetEngine.php

154 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WP Ultimate Exporter plugin file.
4 *
5 * Copyright (C) 2010-2020, Smackcoders Inc - info@smackcoders.com
6 */
7 namespace Smackcoders\SMEXP;
8
9 if ( ! defined( 'ABSPATH' ) )
10 exit; // Exit if accessed directly
11
12 /**
13 * Class LearnPressExport
14 * @package Smackcoders\SMEXP
15 */
16
17 class JetEngineExport extends ExportExtension{
18
19 protected static $instance = null,$export_instance;
20 public static function getInstance() {
21 if ( null == self::$instance ) {
22 self::$instance = new self;
23 JetEngineExport::$export_instance = ExportExtension::getInstance();
24 }
25 return self::$instance;
26 }
27
28 /**
29 * CustomerReviewExport constructor.
30 */
31 /**
32 * Function to export the meta information based on Fetch ACF field information to be export
33 * @param $id
34 * @return mixed
35 */
36 public function __construct() {
37
38 global $wpdb;
39 global $optionalType;
40 $this->plugin = Plugin::getInstance();
41
42
43 }
44 public function jetEngineActivate($id)
45 {
46
47 if(is_plugin_active('jet-engine/jet-engine.php')){
48
49 $jetEnginefields = $wpdb->get_results("SELECT id, meta_fields FROM {$wpdb->prefix}jet_post_types WHERE slug = '$optionalType' AND status IN ('publish','built-in')", ARRAY_A);
50 $jetEnginefields[0]['meta_fields']=isset($jetEnginefields[0]['meta_fields'])?$jetEnginefields[0]['meta_fields']:'';
51
52 $unserializedMeta = maybe_unserialize($jetEnginefields[0]['meta_fields']);
53 $unserializedMeta=isset($unserializedMeta)?$unserializedMeta:'';
54
55 if(is_array($unserializedMeta)){
56 foreach($unserializedMeta as $jet_key => $jetValue){
57 $jetFieldLabel = $jetValue['title'];
58 $jetFieldType = $jetValue['type'];
59 if($jetFieldType != 'repeater' && $jetFieldType != 'media' && $jetFieldType != 'gallery' && $jetFieldType != 'posts' && $jetFieldType != 'html' ){
60 $jetFieldNameArr[] = $jetValue['name'];
61 }
62 else{
63 $jetFieldNameArr[] = $jetValue['name'];
64 $fields=$jetValue['repeater-fields'];
65 if(is_array($fields)){
66 foreach($fields as $repFieldKey => $repFieldVal){
67 $jetFieldName[] = $repFieldVal['name'];
68
69 }
70 }
71 }
72 }
73 }
74
75 if(isset($jetFieldName) && is_array($jetFieldName) ){
76 if(is_array($jetFieldNameArr)){
77 $jetCPTFieldsName=array_merge($jetFieldNameArr,$jetFieldName);
78 }
79 else{
80 $jetCPTFieldsName= $jetFieldName;
81 }
82
83 }
84 else{
85 $jetFieldNameArr = isset($jetFieldNameArr) ? $jetFieldNameArr : '';
86 $jetCPTFieldsName= $jetFieldNameArr;
87 }
88
89 //jeteng metabox fields
90
91 global $wpdb;
92
93 $getMetaFields = $wpdb->get_results( $wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name=%s",'jet_engine_meta_boxes'),ARRAY_A);
94 if(!empty($getMetaFields)){
95 $unserializedMeta = maybe_unserialize($getMetaFields[0]['option_value']);
96 }
97 else{
98 $unserializedMeta = '';
99 }
100
101 if(is_array($unserializedMeta)){
102 $arraykeys = array_keys($unserializedMeta);
103
104 foreach($arraykeys as $val){
105 $values = explode('-',$val);
106 $v = $values[1];
107 }
108 }
109
110
111 $jetMetaFieldName = [];
112 if(isset($v)){
113 for($i=1 ; $i<=$v ; $i++){
114 $unserializedMeta['meta-'.$i]= isset($unserializedMeta['meta-'.$i])? $unserializedMeta['meta-'.$i] : '';
115 $fields= $unserializedMeta['meta-'.$i];
116 if(!empty($fields)){
117 foreach($fields['meta_fields'] as $jet_key => $jetValue){
118 if($jetValue['type'] != 'repeater'){
119 $jetMetaFieldName[] = $jetValue['name'];
120 }
121 else{
122 $jetMetaFieldName[] = $jetValue['name'];
123 $jetRepFields = $jetValue['repeater-fields'];
124 foreach($jetRepFields as $jetRepKey => $jetRepVal){
125 $jetRepFieldName[] = $jetRepVal['name'];
126 }
127 }
128 }
129 }
130
131 }
132 }
133 if( isset($jetRepFieldName) && is_array($jetRepFieldName)){
134 if(is_array($jetMetaFieldName)){
135 $jetFName = array_merge($jetMetaFieldName,$jetRepFieldName);
136 }
137 else{
138 $jetFName= $jetRepFieldName;
139 }
140 }
141 else{
142 $jetFName= $jetMetaFieldName;
143 }
144 }
145 else{
146 $jetCPTFieldsName =$jetFName= $jet_tax_fields_name = '';
147 }
148 }
149
150
151 }
152
153 global $jetengine_exp_class;
154 $jetengine_exp_class = new JetEngineExport();