| 1 |
<?php |
| 2 |
/** |
| 3 |
* WP Ultimate Exporter plugin file. |
| 4 |
* |
| 5 |
* Copyright (C) 2010-2020, Smackcoders Inc - info@smackcoders.com |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Smackcoders\SMEXP; |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) |
| 11 |
exit; // Exit if accessed directly |
| 12 |
|
| 13 |
/** |
| 14 |
* Class PostExport |
| 15 |
* @package Smackcoders\WCSV |
| 16 |
*/ |
| 17 |
class PostExport extends ExportExtension{ |
| 18 |
|
| 19 |
protected static $instance = null,$mapping_instance,$export_handler,$export_instance; |
| 20 |
public $offset = 0; |
| 21 |
public $limit; |
| 22 |
public $totalRowCount; |
| 23 |
public static function getInstance() { |
| 24 |
if ( null == self::$instance ) { |
| 25 |
self::$instance = new self; |
| 26 |
self::$export_instance = ExportExtension::getInstance(); |
| 27 |
} |
| 28 |
return self::$instance; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* PostExport constructor. |
| 33 |
*/ |
| 34 |
public function __construct() { |
| 35 |
$this->plugin = Plugin::getInstance(); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Get records based on the post types |
| 40 |
* @param $module |
| 41 |
* @param $optionalType |
| 42 |
* @param $conditions |
| 43 |
* @return array |
| 44 |
*/ |
| 45 |
public function getRecordsBasedOnPostTypes ($module, $optionalType, $conditions ,$offset , $limit ,$headers = '') { |
| 46 |
global $wpdb; |
| 47 |
if($module == 'CustomPosts' && $optionalType == 'nav_menu_item'){ |
| 48 |
$get_menu_id = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}terms AS t LEFT JOIN {$wpdb->prefix}term_taxonomy AS tt ON tt.term_id = t.term_id WHERE tt.taxonomy = 'nav_menu' ", ARRAY_A); |
| 49 |
$get_menu_arr = array_column($get_menu_id, 'term_id'); |
| 50 |
self::$export_instance->totalRowCount = count($get_menu_arr); |
| 51 |
return $get_menu_arr; |
| 52 |
} |
| 53 |
if($module == 'CustomPosts' && $optionalType == 'widgets'){ |
| 54 |
$get_widget_id = $wpdb->get_row("SELECT option_id FROM {$wpdb->prefix}options where option_name = 'widget_recent-posts' ", ARRAY_A); |
| 55 |
self::$export_instance->totalRowCount = 1; |
| 56 |
return $get_widget_id; |
| 57 |
} |
| 58 |
if($module == 'CustomPosts') { |
| 59 |
$module = $optionalType; |
| 60 |
} elseif ($module == 'WooCommerceOrders') { |
| 61 |
$module = 'shop_order'; |
| 62 |
} |
| 63 |
elseif ($module == 'WooCommerceCoupons') { |
| 64 |
$module = 'shop_coupon'; |
| 65 |
} |
| 66 |
elseif ($module == 'WooCommerceRefunds') { |
| 67 |
$module = 'shop_order_refund'; |
| 68 |
} |
| 69 |
elseif ($module == 'WooCommerceVariations') { |
| 70 |
$module = 'product_variation'; |
| 71 |
} |
| 72 |
elseif($module == 'WPeCommerceCoupons'){ |
| 73 |
$module = 'wpsc-coupon'; |
| 74 |
} |
| 75 |
else { |
| 76 |
$module = self::import_post_types($module); |
| 77 |
} |
| 78 |
|
| 79 |
$get_post_ids = "select DISTINCT ID from {$wpdb->prefix}posts"; |
| 80 |
$get_post_ids .= " where post_type = '$module'"; |
| 81 |
|
| 82 |
/** |
| 83 |
* Check for specific status |
| 84 |
*/ |
| 85 |
if($module == 'shop_order'){ |
| 86 |
if(!empty($conditions['specific_status']['status'])) { |
| 87 |
if($conditions['specific_status']['status'] == 'All') { |
| 88 |
$get_post_ids .= " and post_status in ('wc-completed','wc-cancelled','wc-refunded','wc-on-hold','wc-processing','wc-pending')"; |
| 89 |
} elseif($conditions['specific_status']['status'] == 'Completed Orders') { |
| 90 |
$get_post_ids .= " and post_status in ('wc-completed')"; |
| 91 |
} elseif($conditions['specific_status']['status'] == 'Cancelled Orders') { |
| 92 |
$get_post_ids .= " and post_status in ('wc-cancelled')"; |
| 93 |
} elseif($conditions['specific_status']['status'] == 'On Hold Orders') { |
| 94 |
$get_post_ids .= " and post_status in ('wc-on-hold')"; |
| 95 |
} elseif($conditions['specific_status']['status'] == 'Processing Orders') { |
| 96 |
$get_post_ids .= " and post_status in ('wc-processing')"; |
| 97 |
} elseif($conditions['specific_status']['status'] == 'Pending Orders') { |
| 98 |
$get_post_ids .= " and post_status in ('wc-pending')"; |
| 99 |
} |
| 100 |
} else { |
| 101 |
$get_post_ids .= " and post_status in ('wc-completed','wc-cancelled','wc-on-hold','wc-processing','wc-pending')"; |
| 102 |
} |
| 103 |
}elseif ($module == 'shop_coupon') { |
| 104 |
if(!empty($conditions['specific_status']['status'])) { |
| 105 |
if($conditions['specific_status']['status'] == 'All') { |
| 106 |
$get_post_ids .= " and post_status in ('publish','draft','pending')"; |
| 107 |
} elseif($conditions['specific_status']['status']== 'Publish') { |
| 108 |
$get_post_ids .= " and post_status in ('publish')"; |
| 109 |
} elseif($conditions['specific_status']['status'] == 'Draft') { |
| 110 |
$get_post_ids .= " and post_status in ('draft')"; |
| 111 |
} elseif($conditions['specific_status']['status'] == 'Pending') { |
| 112 |
$get_post_ids .= " and post_status in ('pending')"; |
| 113 |
} |
| 114 |
} else { |
| 115 |
$get_post_ids .= " and post_status in ('publish','draft','pending')"; |
| 116 |
} |
| 117 |
|
| 118 |
}elseif ($module == 'shop_order_refund') { |
| 119 |
|
| 120 |
} |
| 121 |
elseif( $module == 'lp_order'){ |
| 122 |
$get_post_ids .= " and post_status in ('lp-pending', 'lp-processing', 'lp-completed', 'lp-cancelled', 'lp-failed')"; |
| 123 |
} |
| 124 |
elseif ($module == 'forum') { |
| 125 |
$get_post_ids .= " and post_status in ('publish','draft','future','private','pending','hidden')"; |
| 126 |
} |
| 127 |
elseif ($module == 'topic') { |
| 128 |
$get_post_ids .= " and post_status in ('publish','draft','future','open','pending','closed','spam')"; |
| 129 |
} |
| 130 |
elseif ($module == 'reply') { |
| 131 |
$get_post_ids .= " and post_status in ('publish','spam','pending')"; |
| 132 |
} |
| 133 |
else { |
| 134 |
if(!empty($conditions['specific_status']['status'])) { |
| 135 |
if($conditions['specific_status']['status'] == 'All') { |
| 136 |
$get_post_ids .= " and post_status in ('publish','draft','future','private','pending')"; |
| 137 |
} elseif($conditions['specific_status']['status'] == 'Publish' || $conditions['specific_status']['status'] == 'Sticky') { |
| 138 |
$get_post_ids .= " and post_status in ('publish')"; |
| 139 |
} elseif($conditions['specific_status']['status'] == 'Draft') { |
| 140 |
$get_post_ids .= " and post_status in ('draft')"; |
| 141 |
} elseif($conditions['specific_status']['status'] == 'Scheduled') { |
| 142 |
$get_post_ids .= " and post_status in ('future')"; |
| 143 |
} elseif($conditions['specific_status']['status'] == 'Private') { |
| 144 |
$get_post_ids .= " and post_status in ('private')"; |
| 145 |
} elseif($conditions['specific_status']['status'] == 'Pending') { |
| 146 |
$get_post_ids .= " and post_status in ('pending')"; |
| 147 |
} elseif($conditions['specific_status']['status'] == 'Protected') { |
| 148 |
$get_post_ids .= " and post_status in ('publish') and post_password != ''"; |
| 149 |
} |
| 150 |
} else { |
| 151 |
$get_post_ids .= " and post_status in ('publish','draft','future','private','pending')"; |
| 152 |
} |
| 153 |
} |
| 154 |
// Check for specific period |
| 155 |
if(!empty($conditions['specific_period']['is_check']) && $conditions['specific_period']['is_check'] == 'true') { |
| 156 |
if($conditions['specific_period']['from'] == $conditions['specific_period']['to']){ |
| 157 |
$get_post_ids .= " and post_date >= '" . $conditions['specific_period']['from'] . "'"; |
| 158 |
}else{ |
| 159 |
$get_post_ids .= " and post_date >= '" . $conditions['specific_period']['from'] . "' and post_date <= '" . $conditions['specific_period']['to'] . " 23:00:00'"; |
| 160 |
} |
| 161 |
} |
| 162 |
if($module == 'woocommerce') |
| 163 |
$get_post_ids .= " and pm.meta_key = '_sku'"; |
| 164 |
|
| 165 |
if($module == 'wpcommerce') |
| 166 |
$get_post_ids .= " and pm.meta_key = '_wpsc_sku'"; |
| 167 |
|
| 168 |
// Check for specific authors |
| 169 |
if(!empty($conditions['specific_authors']['is_check'] == '1')) { |
| 170 |
if(isset($conditions['specific_authors']['author'])) { |
| 171 |
$get_post_ids .= " and post_author = {$conditions['specific_authors']['author']}"; |
| 172 |
} |
| 173 |
} |
| 174 |
//WpeCommercecoupons |
| 175 |
if($module == 'wpsc-coupon'){ |
| 176 |
$get_post_ids = "select DISTINCT ID from {$wpdb->prefix}wpsc_coupon_codes"; |
| 177 |
} |
| 178 |
//WpeCommercecoupons |
| 179 |
$get_total_row_count = $wpdb->get_col($get_post_ids); |
| 180 |
if(!empty($conditions['specific_period']['is_check']) && $conditions['specific_period']['is_check'] == 'true') { |
| 181 |
if($conditions['specific_period']['from'] == $conditions['specific_period']['to']){ |
| 182 |
$result = array(); |
| 183 |
foreach($get_total_row_count as $result_value){ |
| 184 |
$get_post_date_time = $wpdb->get_results( $wpdb->prepare("SELECT post_date FROM {$wpdb->prefix}posts WHERE id=$result_value") ,ARRAY_A); |
| 185 |
$get_post_date = date("Y-m-d",strtotime($get_post_date_time[0]['post_date'] )); |
| 186 |
if($get_post_date == $conditions['specific_period']['from']){ |
| 187 |
$get_post_date_value[] = $result_value; |
| 188 |
} |
| 189 |
} |
| 190 |
self::$export_instance->totalRowCount = count($get_post_date_value); |
| 191 |
$result = $get_post_date_value; |
| 192 |
} |
| 193 |
else{ |
| 194 |
self::$export_instance->totalRowCount = count($get_total_row_count); |
| 195 |
$offset_limit = " order by ID asc limit $offset, $limit"; |
| 196 |
$query_with_offset_limit = $get_post_ids . $offset_limit; |
| 197 |
$result = $wpdb->get_col($query_with_offset_limit); |
| 198 |
} |
| 199 |
} |
| 200 |
else{ |
| 201 |
self::$export_instance->totalRowCount = count($get_total_row_count); |
| 202 |
//$offset = self::$export_instance->offset; |
| 203 |
//$limit = self::$export_instance->limit; |
| 204 |
$offset_limit = " order by ID asc limit $offset, $limit"; |
| 205 |
$query_with_offset_limit = $get_post_ids . $offset_limit; |
| 206 |
$result = $wpdb->get_col($query_with_offset_limit); |
| 207 |
} |
| 208 |
// Get sticky post alone on the specific post status |
| 209 |
if(isset($conditions['specific_period']['is_check']) && isset($conditions['specific_status']['is_check']) && $conditions['specific_status']['is_check'] == 'true') { |
| 210 |
if(isset($conditions['specific_status']['status']) && $conditions['specific_status']['status'] == 'Sticky') { |
| 211 |
$get_sticky_posts = get_option('sticky_posts'); |
| 212 |
foreach($get_sticky_posts as $sticky_post_id) { |
| 213 |
if(in_array($sticky_post_id, $result)) |
| 214 |
$sticky_posts[] = $sticky_post_id; |
| 215 |
} |
| 216 |
return $sticky_posts; |
| 217 |
} |
| 218 |
} |
| 219 |
return $result; |
| 220 |
} |
| 221 |
|
| 222 |
public function import_post_types($import_type, $importAs = null) { |
| 223 |
$import_type = trim($import_type); |
| 224 |
$module = array('Posts' => 'post', 'Pages' => 'page', 'Users' => 'user', 'Comments' => 'comments', 'Taxonomies' => $importAs, 'CustomerReviews' =>'wpcr3_review', 'Categories' => 'categories', 'Tags' => 'tags', 'WooCommerce' => 'product', 'WPeCommerce' => 'wpsc-product','WPeCommerceCoupons' => 'wpsc-product','WooCommerceVariations' => 'product', 'WooCommerceOrders' => 'product', 'WooCommerceCoupons' => 'product', 'WooCommerceRefunds' => 'product', 'CustomPosts' => $importAs); |
| 225 |
foreach (get_taxonomies() as $key => $taxonomy) { |
| 226 |
$module[$taxonomy] = $taxonomy; |
| 227 |
} |
| 228 |
if(array_key_exists($import_type, $module)) { |
| 229 |
return $module[$import_type]; |
| 230 |
} |
| 231 |
else { |
| 232 |
return $import_type; |
| 233 |
} |
| 234 |
} |
| 235 |
|
| 236 |
/** |
| 237 |
* Function to export the meta information based on Fetch ACF field information to be export |
| 238 |
* @param $id |
| 239 |
* @return mixed |
| 240 |
*/ |
| 241 |
public function getPostsMetaDataBasedOnRecordId ($id, $module, $optionalType) { |
| 242 |
|
| 243 |
global $wpdb; |
| 244 |
$typeOftypesField = NULL; $checkRep = NULL; $allacf= NULL; $alltype = NULL; $parent = NULL; $typesf= NULL;$jet_metafields=NULL; |
| 245 |
if($module == 'Users'){ |
| 246 |
$query = $wpdb->prepare("SELECT user_id,meta_key,meta_value FROM {$wpdb->prefix}users wp JOIN {$wpdb->prefix}usermeta wpm ON wpm.user_id = wp.ID where meta_key NOT IN (%s,%s) AND ID=%d", '_edit_lock', '_edit_last', $id); |
| 247 |
}else if($module == 'Categories' || $module == 'Taxonomies' || $module == 'Tags'){ |
| 248 |
//$query = $wpdb->prepare("SELECT term_id,meta_key,meta_value FROM {$wpdb->prefix}terms wp JOIN {$wpdb->prefix}termmeta wpm ON wpm.term_id = wp.ID where meta_key NOT IN (%s,%s) AND ID=%d", '_edit_lock', '_edit_last', $id); |
| 249 |
$query = $wpdb->prepare("SELECT wp.term_id,meta_key,meta_value FROM {$wpdb->prefix}terms wp JOIN {$wpdb->prefix}termmeta wpm ON wpm.term_id = wp.term_id where meta_key NOT IN (%s,%s) AND wp.term_id = %d", '_edit_lock', '_edit_last', $id); |
| 250 |
}else{ |
| 251 |
$query = $wpdb->prepare("SELECT post_id,meta_key,meta_value FROM {$wpdb->prefix}posts wp JOIN {$wpdb->prefix}postmeta wpm ON wpm.post_id = wp.ID where meta_key NOT IN (%s,%s) AND ID=%d", '_edit_lock', '_edit_last', $id); |
| 252 |
} |
| 253 |
|
| 254 |
$get_acf_fields = $wpdb->get_results("SELECT ID, post_excerpt, post_content, post_name, post_parent, post_type FROM {$wpdb->prefix}posts where post_type = 'acf-field'", ARRAY_A); |
| 255 |
|
| 256 |
$group_unset = array('customer_email', 'product_categories', 'exclude_product_categories'); |
| 257 |
|
| 258 |
if(!empty($get_acf_fields)){ |
| 259 |
foreach ($get_acf_fields as $key => $value) { |
| 260 |
|
| 261 |
if(!empty($value['post_parent'])){ |
| 262 |
$parent = get_post($value['post_parent']); |
| 263 |
if(!empty($parent)){ |
| 264 |
if($parent->post_type == 'acf-field'){ |
| 265 |
$allacf[$value['post_excerpt']] = $parent->post_excerpt.'_'.$value['post_excerpt']; |
| 266 |
}else{ |
| 267 |
$allacf[$value['post_excerpt']] = $value['post_excerpt']; |
| 268 |
} |
| 269 |
}else{ |
| 270 |
$allacf[$value['post_excerpt']] = $value['post_excerpt']; |
| 271 |
} |
| 272 |
}else{ |
| 273 |
$allacf[$value['post_excerpt']] = $value['post_excerpt']; |
| 274 |
} |
| 275 |
|
| 276 |
self::$export_instance->allacf = $allacf; |
| 277 |
|
| 278 |
$content = unserialize($value['post_content']); |
| 279 |
$alltype[$value['post_excerpt']] = $content['type']; |
| 280 |
|
| 281 |
if($content['type'] == 'repeater' || $content['type'] == 'flexible_content'){ |
| 282 |
$checkRep[$value['post_excerpt']] = $this->getRepeater($value['ID']); |
| 283 |
}else{ |
| 284 |
$checkRep[$value['post_excerpt']] = ""; |
| 285 |
} |
| 286 |
} |
| 287 |
} |
| 288 |
|
| 289 |
self::$export_instance->allpodsfields = $this->getAllPodsFields(); |
| 290 |
|
| 291 |
self::$export_instance->alltoolsetfields = get_option('wpcf-fields'); |
| 292 |
|
| 293 |
if(!empty(self::$export_instance->alltoolsetfields)){ |
| 294 |
$i = 1; |
| 295 |
foreach (self::$export_instance->alltoolsetfields as $key => $value) { |
| 296 |
$typesf[$i] = 'wpcf-'.$key; |
| 297 |
$typeOftypesField[$typesf[$i]] = $value['type']; |
| 298 |
$i++; |
| 299 |
} |
| 300 |
} |
| 301 |
|
| 302 |
self::$export_instance->typeOftypesField = $typeOftypesField; |
| 303 |
|
| 304 |
$result = $wpdb->get_results($query); |
| 305 |
|
| 306 |
// jeteng fields |
| 307 |
if(is_plugin_active('jet-engine/jet-engine.php')){ |
| 308 |
|
| 309 |
$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); |
| 310 |
$jetEnginefields[0]['meta_fields']=isset($jetEnginefields[0]['meta_fields'])?$jetEnginefields[0]['meta_fields']:''; |
| 311 |
|
| 312 |
$unserializedMeta = maybe_unserialize($jetEnginefields[0]['meta_fields']); |
| 313 |
$unserializedMeta=isset($unserializedMeta)?$unserializedMeta:''; |
| 314 |
|
| 315 |
if(is_array($unserializedMeta)){ |
| 316 |
foreach($unserializedMeta as $jet_key => $jetValue){ |
| 317 |
$jetFieldLabel = $jetValue['title']; |
| 318 |
$jetFieldType = $jetValue['type']; |
| 319 |
if($jetFieldType != 'repeater' && $jetFieldType != 'media' && $jetFieldType != 'gallery' && $jetFieldType != 'posts' && $jetFieldType != 'html' ){ |
| 320 |
$jetFieldNameArr[] = $jetValue['name']; |
| 321 |
} |
| 322 |
else{ |
| 323 |
$jetFieldNameArr[] = $jetValue['name']; |
| 324 |
$fields=$jetValue['repeater-fields']; |
| 325 |
if(is_array($fields)){ |
| 326 |
foreach($fields as $repFieldKey => $repFieldVal){ |
| 327 |
$jetFieldName[] = $repFieldVal['name']; |
| 328 |
|
| 329 |
} |
| 330 |
} |
| 331 |
} |
| 332 |
} |
| 333 |
} |
| 334 |
|
| 335 |
if(isset($jetFieldName) && is_array($jetFieldName) ){ |
| 336 |
if(is_array($jetFieldNameArr)){ |
| 337 |
$jetCPTFieldsName=array_merge($jetFieldNameArr,$jetFieldName); |
| 338 |
} |
| 339 |
else{ |
| 340 |
$jetCPTFieldsName= $jetFieldName; |
| 341 |
} |
| 342 |
|
| 343 |
} |
| 344 |
else{ |
| 345 |
$jetFieldNameArr = isset($jetFieldNameArr) ? $jetFieldNameArr : ''; |
| 346 |
$jetCPTFieldsName= $jetFieldNameArr; |
| 347 |
} |
| 348 |
|
| 349 |
//jeteng metabox fields |
| 350 |
|
| 351 |
global $wpdb; |
| 352 |
//$getMetaFields = $wpdb->get_results( $wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name='jet_engine_meta_boxes'"),ARRAY_A); |
| 353 |
$getMetaFields = $wpdb->get_results( $wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name=%s",'jet_engine_meta_boxes'),ARRAY_A); |
| 354 |
if(!empty($getMetaFields)){ |
| 355 |
$unserializedMeta = maybe_unserialize($getMetaFields[0]['option_value']); |
| 356 |
} |
| 357 |
else{ |
| 358 |
$unserializedMeta = ''; |
| 359 |
} |
| 360 |
|
| 361 |
if(is_array($unserializedMeta)){ |
| 362 |
$arraykeys = array_keys($unserializedMeta); |
| 363 |
|
| 364 |
foreach($arraykeys as $val){ |
| 365 |
$values = explode('-',$val); |
| 366 |
$v = $values[1]; |
| 367 |
} |
| 368 |
} |
| 369 |
|
| 370 |
|
| 371 |
$jetMetaFieldName = []; |
| 372 |
if(isset($v)){ |
| 373 |
for($i=1 ; $i<=$v ; $i++){ |
| 374 |
$unserializedMeta['meta-'.$i]= isset($unserializedMeta['meta-'.$i])? $unserializedMeta['meta-'.$i] : ''; |
| 375 |
$fields= $unserializedMeta['meta-'.$i]; |
| 376 |
if(!empty($fields)){ |
| 377 |
foreach($fields['meta_fields'] as $jet_key => $jetValue){ |
| 378 |
if($jetValue['type'] != 'repeater'){ |
| 379 |
$jetMetaFieldName[] = $jetValue['name']; |
| 380 |
} |
| 381 |
else{ |
| 382 |
$jetMetaFieldName[] = $jetValue['name']; |
| 383 |
$jetRepFields = $jetValue['repeater-fields']; |
| 384 |
foreach($jetRepFields as $jetRepKey => $jetRepVal){ |
| 385 |
$jetRepFieldName[] = $jetRepVal['name']; |
| 386 |
} |
| 387 |
} |
| 388 |
} |
| 389 |
} |
| 390 |
|
| 391 |
} |
| 392 |
} |
| 393 |
if( isset($jetRepFieldName) && is_array($jetRepFieldName)){ |
| 394 |
if(is_array($jetMetaFieldName)){ |
| 395 |
$jetFName = array_merge($jetMetaFieldName,$jetRepFieldName); |
| 396 |
} |
| 397 |
else{ |
| 398 |
$jetFName= $jetRepFieldName; |
| 399 |
} |
| 400 |
} |
| 401 |
else{ |
| 402 |
$jetFName= $jetMetaFieldName; |
| 403 |
} |
| 404 |
} |
| 405 |
else{ |
| 406 |
$jetCPTFieldsName =$jetFName= $jet_tax_fields_name = ''; |
| 407 |
} |
| 408 |
|
| 409 |
//added for metabox plugin fields |
| 410 |
if(is_plugin_active('meta-box/meta-box.php')){ |
| 411 |
$metabox_import_type = self::import_post_types($module, $optionalType); |
| 412 |
$metabox_fields = \rwmb_get_object_fields( $metabox_import_type ); |
| 413 |
} |
| 414 |
else{ |
| 415 |
$metabox_fields = []; |
| 416 |
} |
| 417 |
|
| 418 |
if(!empty($result)) { |
| 419 |
|
| 420 |
foreach($result as $key => $value) { |
| 421 |
|
| 422 |
if($value->meta_key == 'rank_math_schema_BlogPosting'){ |
| 423 |
$rank_value=$value->meta_value; |
| 424 |
$rank_math=unserialize($rank_value) ; |
| 425 |
$headline=$rank_math['headline']; |
| 426 |
$schema_description=$rank_math['description']; |
| 427 |
$article_type=$rank_math['@type']; |
| 428 |
$re_id = $wpdb->get_results("SELECT redirection_id FROM {$wpdb->prefix}rank_math_redirections_cache where object_id='$id'"); |
| 429 |
$redirect_id=$re_id[0]; |
| 430 |
$redirection_id=$redirect_id->redirection_id; |
| 431 |
$result = $wpdb->get_results("SELECT url_to,header_code FROM {$wpdb->prefix}rank_math_redirections where id='$redirection_id'"); |
| 432 |
$rank_math_redirections=$result[0]; |
| 433 |
$url_to=$rank_math_redirections->url_to; |
| 434 |
$header_code=$rank_math_redirections->header_code; |
| 435 |
|
| 436 |
self::$export_instance->data[$id]['headline'] = $headline; |
| 437 |
self::$export_instance->data[$id]['schema_description'] = $schema_description; |
| 438 |
self::$export_instance->data[$id]['article_type'] = $article_type; |
| 439 |
self::$export_instance->data[$id]['destination_url'] = $url_to; |
| 440 |
self::$export_instance->data[$id]['redirection_type'] = $header_code; |
| 441 |
} |
| 442 |
if($value->meta_key == 'rank_math_advanced_robots'){ |
| 443 |
$rank_robots_value=$value->meta_value; |
| 444 |
$rank_robots=unserialize($rank_robots_value); |
| 445 |
$max_snippet=$rank_robots['max-snippet']; |
| 446 |
$max_video_preview=$rank_robots['max-video-preview']; |
| 447 |
$max_image_preview=$rank_robots['max-image-preview']; |
| 448 |
$rank_math_advanced_robots=$max_snippet.','.$max_video_preview.','.$max_image_preview; |
| 449 |
self::$export_instance->data[$id]['rank_math_advanced_robots'] = $rank_math_advanced_robots; |
| 450 |
} |
| 451 |
if((isset($value->meta_key) && is_array($jetFName))){ |
| 452 |
if(in_array($value->meta_key,$jetFName)){ |
| 453 |
//$getMetaFields = $wpdb->get_results( $wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name='jet_engine_meta_boxes'"),ARRAY_A); |
| 454 |
$getMetaFields = $wpdb->get_results( $wpdb->prepare("SELECT option_value FROM {$wpdb->prefix}options WHERE option_name=%s",'jet_engine_meta_boxes'),ARRAY_A); |
| 455 |
$getMetaFields[0]['option_value'] = isset($getMetaFields[0]) ? $getMetaFields[0]['option_value'] : ''; |
| 456 |
$unserializedMeta = maybe_unserialize($getMetaFields[0]['option_value']); |
| 457 |
//$count =count($unserializedMeta); |
| 458 |
if(is_array($unserializedMeta)){ |
| 459 |
$arraykeys = array_keys($unserializedMeta); |
| 460 |
|
| 461 |
foreach($arraykeys as $val){ |
| 462 |
$values = explode('-',$val); |
| 463 |
$v = $values[1]; |
| 464 |
} |
| 465 |
} |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
for($i=1 ; $i<=$v ; $i++){ |
| 470 |
$unserializedMeta['meta-'.$i] = isset($unserializedMeta['meta-'.$i])? $unserializedMeta['meta-'.$i] :''; |
| 471 |
$fields = $unserializedMeta['meta-'.$i]; |
| 472 |
if(!empty($fields)){ |
| 473 |
$jet_metatypes=array(); |
| 474 |
$jet_reptype=array(); |
| 475 |
foreach($fields['meta_fields'] as $jet_key => $jetValue){ |
| 476 |
$jetFieldLabel = $jetValue['title']; |
| 477 |
$jetFNames = $jetValue['name']; |
| 478 |
$jetFieldType = $jetValue['type']; |
| 479 |
if($jetFieldType != 'repeater'){ |
| 480 |
|
| 481 |
$jet_metafields[$jetFNames]=$jetFNames; |
| 482 |
|
| 483 |
$jet_metatypes[$jetFNames] = $jetFieldType; |
| 484 |
|
| 485 |
} |
| 486 |
else{ |
| 487 |
$jet_metafields[$jetFNames]=$jetFNames; |
| 488 |
$jet_metatypes[$jetFNames] = $jetFieldType; |
| 489 |
$repfields=$jetValue['repeater-fields']; |
| 490 |
$jet_repfield=array(); |
| 491 |
//$jet_reptype=array(); |
| 492 |
foreach($repfields as $repFieldKey => $repFieldVal){ |
| 493 |
$jetRepFields_label = $repFieldVal['name']; |
| 494 |
$jetRepFields_type = $repFieldVal['type']; |
| 495 |
|
| 496 |
$jet_repfield[$jetRepFields_label] = $jetRepFields_label; |
| 497 |
$jet_reptype[$jetRepFields_label] = $jetRepFields_type; |
| 498 |
} |
| 499 |
} |
| 500 |
} |
| 501 |
} |
| 502 |
|
| 503 |
self::$export_instance->jet_metafields = $jet_metafields; |
| 504 |
self::$export_instance->jet_metatypes = $jet_metatypes; |
| 505 |
if(!empty($jet_repfield)){ |
| 506 |
self::$export_instance->jet_repfield = $jet_repfield; |
| 507 |
self::$export_instance->jet_reptype = $jet_reptype; |
| 508 |
} |
| 509 |
else{ |
| 510 |
$jet_repfield = ''; |
| 511 |
$jet_reptype = ''; |
| 512 |
} |
| 513 |
$this->getCustomFieldValue($id, $value, $checkRep, $allacf, $typeOftypesField, $alltype, $jet_metafields, $jet_metatypes, $jet_repfield, $jet_reptype,$parent, $typesf, $group_unset , $optionalType , self::$export_instance->allpodsfields, $metabox_fields, $module); |
| 514 |
} |
| 515 |
} |
| 516 |
} |
| 517 |
if(is_array($jetCPTFieldsName)&& isset($value->meta_key)){ |
| 518 |
if(in_array($value->meta_key,$jetCPTFieldsName)){ |
| 519 |
$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); |
| 520 |
|
| 521 |
if(!empty($jetEnginefields)){ |
| 522 |
$unserializedMeta = maybe_unserialize($jetEnginefields[0]['meta_fields']); |
| 523 |
} |
| 524 |
else{ |
| 525 |
$unserializedMeta = ''; |
| 526 |
} |
| 527 |
$jetTypes=array(); |
| 528 |
$jet_rep_cpttypes=array(); |
| 529 |
foreach($unserializedMeta as $jet_key => $jetValue){ |
| 530 |
$jetFieldLabel = $jetValue['title']; |
| 531 |
$jet_cptfield_names = $jetValue['name']; |
| 532 |
$jetFieldType = $jetValue['type']; |
| 533 |
if($jetFieldType != 'repeater'){ |
| 534 |
$jet_cptfields[$jet_cptfield_names]=$jet_cptfield_names; |
| 535 |
$jetTypes[$jet_cptfield_names] = $jetFieldType; |
| 536 |
} |
| 537 |
else{ |
| 538 |
$jet_cptfields[$jet_cptfield_names]=$jet_cptfield_names; |
| 539 |
$jetTypes[$jet_cptfield_names] = $jetFieldType; |
| 540 |
$fields=$jetValue['repeater-fields']; |
| 541 |
foreach($fields as $repFieldKey => $repFieldVal){ |
| 542 |
$jet_rep_cptfields_label = $repFieldVal['name']; |
| 543 |
$jet_rep_cptfields_type = $repFieldVal['type']; |
| 544 |
$jet_rep_cptfields[$jet_rep_cptfields_label] = $jet_rep_cptfields_label; |
| 545 |
$jet_rep_cpttypes[$jet_rep_cptfields_label] = $jet_rep_cptfields_type; |
| 546 |
} |
| 547 |
} |
| 548 |
|
| 549 |
} |
| 550 |
self::$export_instance->jet_cptfields = $jet_cptfields; |
| 551 |
self::$export_instance->jet_types = $jetTypes; |
| 552 |
if(isset($jet_rep_cptfields)){ |
| 553 |
self::$export_instance->jet_rep_cptfields = $jet_rep_cptfields; |
| 554 |
self::$export_instance->jet_rep_cpttypes = $jet_rep_cpttypes; |
| 555 |
} |
| 556 |
else{ |
| 557 |
$jet_rep_cptfields = ''; |
| 558 |
$jet_rep_cpttypes = ''; |
| 559 |
} |
| 560 |
$this->getCustomFieldValue($id, $value, $checkRep, $allacf, $typeOftypesField, $alltype, $jet_cptfields, $jetTypes, $jet_rep_cptfields, $jet_rep_cpttypes, $parent, $typesf, $group_unset , $optionalType , self::$export_instance->allpodsfields, $metabox_fields, $module); |
| 561 |
} |
| 562 |
} |
| 563 |
else{ |
| 564 |
$jet_fields = $jetFieldType = $jetRepFields = $jet_rep_types = ''; |
| 565 |
$typesf=isset($typesf)?$typesf:''; |
| 566 |
$jetTypes=isset($jetTypes)?$jetTypes:''; |
| 567 |
$this->getCustomFieldValue($id, $value, $checkRep, $allacf, $typeOftypesField, $alltype, $jet_fields , $jetTypes, $jetRepFields, $jet_rep_types, $parent, $typesf, $group_unset , $optionalType , self::$export_instance->allpodsfields ,$metabox_fields, $module); |
| 568 |
} |
| 569 |
} |
| 570 |
} |
| 571 |
|
| 572 |
return self::$export_instance->data; |
| 573 |
} |
| 574 |
|
| 575 |
public function getAllPodsFields(){ |
| 576 |
|
| 577 |
$pods_fields = []; |
| 578 |
if(in_array('pods/init.php', self::$export_instance->get_active_plugins())) { |
| 579 |
global $wpdb; |
| 580 |
$pods_fields_query_result = $wpdb->get_results("SELECT post_name FROM ".$wpdb->prefix."posts WHERE post_type = '_pods_field'"); |
| 581 |
foreach($pods_fields_query_result as $single_result){ |
| 582 |
$pods_fields[] = $single_result->post_name; |
| 583 |
} |
| 584 |
} |
| 585 |
return $pods_fields; |
| 586 |
} |
| 587 |
|
| 588 |
public function getCustomFieldValue($id, $value, $checkRep, $allacf, $typeOftypesField, $alltype, $jet_fields, $jetTypes, $jetRepFields, $jet_rep_types, $parent, $typesf, $group_unset , $optionalType , $pods_type, $metabox_fields, $module){ |
| 589 |
global $wpdb; |
| 590 |
$taxonomies = get_taxonomies(); |
| 591 |
$down_file = false; |
| 592 |
|
| 593 |
if ($value->meta_key == '_thumbnail_id') { |
| 594 |
$attachment_file = null; |
| 595 |
$get_attachment = $wpdb->prepare("select guid from {$wpdb->prefix}posts where ID = %d AND post_type = %s", $value->meta_value, 'attachment'); |
| 596 |
$attachment_file = $wpdb->get_var($get_attachment); |
| 597 |
self::$export_instance->data[$id][$value->meta_key] = ''; |
| 598 |
$value->meta_key = 'featured_image'; |
| 599 |
self::$export_instance->data[$id][$value->meta_key] = $attachment_file; |
| 600 |
}else if($value->meta_key == '_downloadable_files'){ |
| 601 |
$downfiles = unserialize($value->meta_value); |
| 602 |
if(!empty($downfiles)){ |
| 603 |
foreach($downfiles as $dk => $dv){ |
| 604 |
$down_file .= $dv['name'].','.$dv['file'].'|'; |
| 605 |
} |
| 606 |
self::$export_instance->data[$id]['downloadable_files'] = rtrim($down_file,"|"); |
| 607 |
} |
| 608 |
} |
| 609 |
elseif($value->meta_key == '_downloadable'){ |
| 610 |
self::$export_instance->data[$id]['downloadable'] = $value->meta_value; |
| 611 |
} |
| 612 |
elseif($value->meta_key == '_upsell_ids'){ |
| 613 |
$upselldata = unserialize($value->meta_value); |
| 614 |
if(!empty($upselldata)){ |
| 615 |
foreach($upselldata as $upselldata_value){ |
| 616 |
$upselldata_query = $wpdb->prepare("SELECT post_title FROM {$wpdb->prefix}posts where id = %d", $upselldata_value); |
| 617 |
$upselldata_value=$wpdb->get_results($upselldata_query); |
| 618 |
$upselldata_item[] = $upselldata_value[0]->post_title; |
| 619 |
} |
| 620 |
$upsellids = implode(',',$upselldata_item); |
| 621 |
self::$export_instance->data[$id]['upsell_ids'] = $upsellids; |
| 622 |
} |
| 623 |
} |
| 624 |
elseif($value->meta_key == '_crosssell_ids'){ |
| 625 |
$cross_selldata = unserialize($value->meta_value); |
| 626 |
if(!empty($cross_selldata)){ |
| 627 |
foreach($cross_selldata as $cross_selldata_value){ |
| 628 |
$cross_selldata_query = $wpdb->prepare("SELECT post_title FROM {$wpdb->prefix}posts where id = %d", $cross_selldata_value); |
| 629 |
$cross_selldata_value=$wpdb->get_results($cross_selldata_query); |
| 630 |
|
| 631 |
$cross_selldata_item[] = $cross_selldata_value[0]->post_title; |
| 632 |
} |
| 633 |
$cross_sellids = implode(',',$cross_selldata_item); |
| 634 |
self::$export_instance->data[$id]['crosssell_ids'] = $cross_sellids; |
| 635 |
} |
| 636 |
} |
| 637 |
elseif($value->meta_key == '_wc_pb_bundle_sell_ids'){ |
| 638 |
$bundleselldata = unserialize($value->meta_value); |
| 639 |
if(!empty($bundleselldata) && is_array($bundleselldata)){ |
| 640 |
$bundsell = []; |
| 641 |
foreach($bundleselldata as $bundle_id){ |
| 642 |
$bundleids = $wpdb->get_results("SELECT post_title FROM {$wpdb->prefix}posts WHERE post_type = 'product' AND ID = '$bundle_id'"); |
| 643 |
foreach($bundleids as $bundid){ |
| 644 |
$bundsell[] = $bundid->post_title; |
| 645 |
} |
| 646 |
} |
| 647 |
$value->meta_value = implode(',',$bundsell); |
| 648 |
self::$export_instance->data[$id]['_wc_pb_bundle_sell_ids'] = $value->meta_value; |
| 649 |
} |
| 650 |
} |
| 651 |
elseif($value->meta_key == '_children'){ |
| 652 |
$grpdata = unserialize($value->meta_value); |
| 653 |
if(!empty($grpdata)){ |
| 654 |
$grpids = implode(',',$grpdata); |
| 655 |
self::$export_instance->data[$id]['grouping_product'] = $grpids; |
| 656 |
} |
| 657 |
}elseif($value->meta_key == '_product_image_gallery'){ |
| 658 |
if(strpos($value->meta_value, ',') !== false) { |
| 659 |
$file_data = explode(',',$value->meta_value); |
| 660 |
foreach($file_data as $k => $v){ |
| 661 |
$attachment = wp_get_attachment_image_src($v); |
| 662 |
$attach[$k] = $attachment[0]; |
| 663 |
} |
| 664 |
|
| 665 |
$gallery_data = ''; |
| 666 |
foreach($attach as $values){ |
| 667 |
$gallery_data .= $values.'|'; |
| 668 |
} |
| 669 |
$gallery_data = rtrim($gallery_data , '|'); |
| 670 |
self::$export_instance->data[$id]['product_image_gallery'] = $gallery_data; |
| 671 |
}else{ |
| 672 |
$attachment = wp_get_attachment_image_src($value->meta_value); |
| 673 |
self::$export_instance->data[$id]['product_image_gallery'] = $attachment[0]; |
| 674 |
} |
| 675 |
}elseif($value->meta_key == '_sale_price_dates_from'){ |
| 676 |
$sales_price_date_from_value = ''; |
| 677 |
if(!empty($value->meta_value)){ |
| 678 |
$sales_price_date_from_value = date('Y-m-d',$value->meta_value); |
| 679 |
} |
| 680 |
self::$export_instance->data[$id]['sale_price_dates_from'] = $sales_price_date_from_value; |
| 681 |
} |
| 682 |
elseif($value->meta_key == '_lp_faqs'){ |
| 683 |
$faqs=$value->meta_value; |
| 684 |
$unserialize_faq_value=unserialize($faqs); |
| 685 |
foreach($unserialize_faq_value as $faq_key=>$faq_value){ |
| 686 |
$faqs_value .= $faq_value[0].','.$faq_value[1].'|'; |
| 687 |
} |
| 688 |
self::$export_instance->data[$id][ $value->meta_key ] = rtrim($faqs_value,'|'); |
| 689 |
} |
| 690 |
elseif($value->meta_key == '_sale_price_dates_to'){ |
| 691 |
$sales_price_dates_value = ''; |
| 692 |
if(!empty($value->meta_value)){ |
| 693 |
$sales_price_dates_value = date('Y-m-d',$value->meta_value); |
| 694 |
} |
| 695 |
self::$export_instance->data[$id]['sale_price_dates_to'] = $sales_price_dates_value; |
| 696 |
}else { |
| 697 |
|
| 698 |
// Mari commented this if statement |
| 699 |
// if(preg_match('/group_/',$value->meta_key)){ |
| 700 |
// $value->meta_key = preg_replace('/group_/','', $value->meta_key ); |
| 701 |
// } |
| 702 |
|
| 703 |
|
| 704 |
if(isset($allacf) && array_search($value->meta_key, $allacf)){ |
| 705 |
$repeaterOfrepeater = false; |
| 706 |
$getType = $alltype[$value->meta_key]; |
| 707 |
if(empty($getType)){ |
| 708 |
$tempFieldname = array_search($value->meta_key, $allacf); |
| 709 |
$getType = $alltype[$tempFieldname]; |
| 710 |
} |
| 711 |
|
| 712 |
if ($getType == 'flexible_content' || $getType == 'repeater') { |
| 713 |
if(is_serialized($value->meta_value)){ |
| 714 |
$value->meta_value = unserialize($value->meta_value); |
| 715 |
$count = count($value->meta_value); |
| 716 |
}else{ |
| 717 |
$count = $value->meta_value; |
| 718 |
} |
| 719 |
|
| 720 |
$getRF = $checkRep[$value->meta_key]; |
| 721 |
$repeater_data = []; |
| 722 |
|
| 723 |
if($getType == 'flexible_content'){ |
| 724 |
$flexible_value = ''; |
| 725 |
foreach($value->meta_value as $values){ |
| 726 |
$flexible_value .= $values.'|'; |
| 727 |
} |
| 728 |
$flexible_value = rtrim($flexible_value , '|'); |
| 729 |
self::$export_instance->data[$id][$value->meta_key] = self::$export_instance->returnMetaValueAsCustomerInput($flexible_value); |
| 730 |
} |
| 731 |
|
| 732 |
foreach ($getRF as $rep => $rep1) { |
| 733 |
$repType = $alltype[$rep1]; |
| 734 |
|
| 735 |
$reval = ""; |
| 736 |
for($z=0;$z<$count;$z++){ |
| 737 |
$var = $value->meta_key.'_'.$z.'_'.$rep1; |
| 738 |
|
| 739 |
if(in_array($optionalType , $taxonomies)){ |
| 740 |
$qry = $wpdb->get_results($wpdb->prepare("SELECT meta_value FROM {$wpdb->prefix}terms wp JOIN {$wpdb->prefix}termmeta wpm ON wpm.term_id = wp.term_id where meta_key = %s AND wp.term_id = %d", $var, $id)); |
| 741 |
}else{ |
| 742 |
$qry = $wpdb->get_results($wpdb->prepare("SELECT meta_value FROM {$wpdb->prefix}posts wp JOIN {$wpdb->prefix}postmeta wpm ON wpm.post_id = wp.ID where meta_key = %s AND ID=%d", $var, $id)); |
| 743 |
} |
| 744 |
|
| 745 |
$meta = $qry[0]->meta_value; |
| 746 |
if($repType == 'image') |
| 747 |
$meta = $this->getAttachment($meta); |
| 748 |
if($repType == 'file') |
| 749 |
$meta =$this->getAttachment($meta); |
| 750 |
if($repType == 'repeater' || $repType == 'flexible_content') |
| 751 |
$meta = $this->getRepeaterofRepeater($value->meta_key); |
| 752 |
if(is_serialized($meta)) |
| 753 |
{ |
| 754 |
$unmeta = unserialize($meta); |
| 755 |
$meta = ""; |
| 756 |
foreach ($unmeta as $unmeta1) { |
| 757 |
if($repType == 'image' || $repType == 'gallery') |
| 758 |
$meta .= $this->getAttachment($unmeta1).","; |
| 759 |
elseif($repType == 'taxonomy') { |
| 760 |
$meta .=$unmeta1.','; |
| 761 |
} |
| 762 |
elseif($repType == 'user') { |
| 763 |
$meta .=$unmeta1.','; |
| 764 |
} |
| 765 |
elseif($repType == 'post_object') { |
| 766 |
$meta .=$unmeta1.','; |
| 767 |
} |
| 768 |
elseif($repType == 'relationship') { |
| 769 |
$meta .=$unmeta1.','; |
| 770 |
} |
| 771 |
elseif($repType == 'page_link') { |
| 772 |
$meta .=$unmeta1.','; |
| 773 |
} |
| 774 |
elseif($repType == 'link') { |
| 775 |
$meta .=$unmeta1; |
| 776 |
} |
| 777 |
|
| 778 |
|
| 779 |
else |
| 780 |
$meta .= $unmeta1.","; |
| 781 |
} |
| 782 |
$meta = rtrim($meta,','); |
| 783 |
} |
| 784 |
if($meta != "") |
| 785 |
$reval .= $meta."|"; |
| 786 |
} |
| 787 |
self::$export_instance->data[$id][$rep1] = self::$export_instance->returnMetaValueAsCustomerInput(rtrim($reval,'|')); |
| 788 |
} |
| 789 |
} |
| 790 |
elseif( is_serialized($value->meta_value)){ |
| 791 |
|
| 792 |
$acfva = unserialize($value->meta_value); |
| 793 |
$acfdata = ""; |
| 794 |
foreach ($acfva as $key1 => $value1) { |
| 795 |
if($getType == 'checkbox') |
| 796 |
$acfdata .= $value1.','; |
| 797 |
elseif($getType == 'gallery' || $getType == 'image'){ |
| 798 |
$attach = $this->getAttachment($value1); |
| 799 |
$acfdata .= $attach.','; |
| 800 |
} |
| 801 |
elseif($getType == 'google_map') |
| 802 |
{ |
| 803 |
$acfdata=$acfva['address']; |
| 804 |
} |
| 805 |
else{ |
| 806 |
if(!empty($value1)) { |
| 807 |
$acfdata .= $value1.','; |
| 808 |
} |
| 809 |
} |
| 810 |
|
| 811 |
} |
| 812 |
self::$export_instance->data[$id][ $value->meta_key ] = self::$export_instance->returnMetaValueAsCustomerInput(rtrim($acfdata,',')); |
| 813 |
} |
| 814 |
elseif($getType == 'gallery' || $getType == 'image'|| $getType == 'file' ){ |
| 815 |
$attach1 = $this->getAttachment($value->meta_value); |
| 816 |
self::$export_instance->data[$id][ $value->meta_key ] = $attach1; |
| 817 |
} |
| 818 |
else{ |
| 819 |
self::$export_instance->data[$id][ $value->meta_key ] = self::$export_instance->returnMetaValueAsCustomerInput($value->meta_value); |
| 820 |
} |
| 821 |
} |
| 822 |
elseif(is_array($jet_fields) && in_array($value->meta_key, $jet_fields) && !empty($value->meta_value)){ |
| 823 |
$getjetType = isset($jetTypes[$value->meta_key]) ? $jetTypes[$value->meta_key] : ''; |
| 824 |
if(empty($getjetType)){ |
| 825 |
$tempFieldname = array_search($value->meta_key, $jet_fields); |
| 826 |
$getjetType = isset($jetTypes[$tempFieldname]) ? $jetTypes[$tempFieldname] : ''; |
| 827 |
} |
| 828 |
|
| 829 |
if($getjetType == 'checkbox' && is_string($value->meta_value)){ |
| 830 |
$value->meta_value = unserialize($value->meta_value); |
| 831 |
$check = ''; |
| 832 |
foreach($value->meta_value as $key => $metvalue){ |
| 833 |
if(is_numeric($key)){ |
| 834 |
$check .= $metvalue.','; |
| 835 |
$rcheck = substr($check,0,-1); |
| 836 |
self::$export_instance->data[$id][ $value->meta_key ] = $rcheck; |
| 837 |
} |
| 838 |
else{ |
| 839 |
if($metvalue == 'true'){ |
| 840 |
|
| 841 |
$exp_value[] = $key; |
| 842 |
} |
| 843 |
if(isset($exp_value) && is_array($exp_value)){ |
| 844 |
$value->meta_value = implode(',',$exp_value ); |
| 845 |
} |
| 846 |
|
| 847 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 848 |
} |
| 849 |
|
| 850 |
} |
| 851 |
|
| 852 |
} |
| 853 |
elseif($getjetType == 'select'){ |
| 854 |
if(is_serialized($value->meta_value)){ |
| 855 |
$value->meta_value = unserialize($value->meta_value); |
| 856 |
foreach($value->meta_value as $metkey => $metselectvalue){ |
| 857 |
$select[] = $metselectvalue; |
| 858 |
$value->meta_value = implode(',',$select ); |
| 859 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 860 |
} |
| 861 |
} |
| 862 |
else{ |
| 863 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 864 |
} |
| 865 |
} |
| 866 |
elseif($getjetType == 'date'){ |
| 867 |
if(!empty($value->meta_value)){ |
| 868 |
if(strpos($value->meta_value, '-') !== FALSE){ |
| 869 |
}else{ |
| 870 |
$value->meta_value = date('Y-m-d', $value->meta_value); |
| 871 |
} |
| 872 |
} |
| 873 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 874 |
} |
| 875 |
elseif($getjetType == 'datetime-local'){ |
| 876 |
if(!empty($value->meta_value)){ |
| 877 |
if(strpos($value->meta_value, '-') !== FALSE){ |
| 878 |
}else{ |
| 879 |
$value->meta_value = date('Y-m-d H:i', $value->meta_value); |
| 880 |
} |
| 881 |
$value->meta_value = str_replace(' ', 'T', $value->meta_value); |
| 882 |
} |
| 883 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 884 |
} |
| 885 |
else{ |
| 886 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 887 |
} |
| 888 |
} |
| 889 |
elseif (!empty($typesf) && in_array($value->meta_key, $typesf)) { |
| 890 |
$typeoftype = $typeOftypesField[$value->meta_key]; |
| 891 |
if(is_serialized($value->meta_value)){ |
| 892 |
$typeFileds = unserialize($value->meta_value); |
| 893 |
$typedata = ""; |
| 894 |
foreach ($typeFileds as $key2 => $value2) { |
| 895 |
if(is_array($value2)){ |
| 896 |
foreach ($value2 as $keytypeOftypesField3 => $value3) { |
| 897 |
$typedata .= $value3.','; |
| 898 |
} |
| 899 |
} |
| 900 |
else{ |
| 901 |
$typedata .= $value2.','; |
| 902 |
} |
| 903 |
} |
| 904 |
|
| 905 |
if(preg_match('/wpcf-/', $value->meta_key)){ |
| 906 |
$value->meta_key = preg_replace('/wpcf-/', '', $value->meta_key); |
| 907 |
} |
| 908 |
|
| 909 |
self::$export_instance->data[$id][ $value->meta_key ] = substr($typedata, 0, -1); |
| 910 |
} |
| 911 |
elseif ($typeoftype == 'date') { |
| 912 |
self::$export_instance->data[$id][ $value->meta_key ] = date('Y-m-d', $value->meta_value); |
| 913 |
} |
| 914 |
else{ |
| 915 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 916 |
} |
| 917 |
//TYPES Allow multiple-instances of this field |
| 918 |
$multi_row = '_'.$value->meta_key.'-sort-order'; |
| 919 |
$multi_data = get_post_meta($id,$multi_row); |
| 920 |
$multi_data = $multi_data[0]; |
| 921 |
if(is_array($multi_data)){ |
| 922 |
foreach($multi_data as $k => $mid){ |
| 923 |
$m_data = $this->get_common_post_metadata($mid); |
| 924 |
if($typeoftype == 'date') |
| 925 |
$multi_data[$k] = date('Y-m-d H:i:s',$m_data['meta_value']); |
| 926 |
else |
| 927 |
$multi_data[$k] = $m_data['meta_value']; } |
| 928 |
self::$export_instance->data[$id][ $value->meta_key ] = implode('|',$multi_data); |
| 929 |
if(preg_match('/wpcf-/',$value->meta_key)){ |
| 930 |
$value->meta_key = preg_replace('/wpcf-/','', $value->meta_key ); |
| 931 |
self::$export_instance->data[$id][ $value->meta_key ] = implode('|',$multi_data); |
| 932 |
} |
| 933 |
if(preg_match('/group_/',$value->meta_key)){ |
| 934 |
$getType = $alltype[$value->meta_key]; |
| 935 |
if($value->meta_key == 'group_gallery' || $value->meta_key == 'group_image'|| $value->meta_key == 'file' ){ |
| 936 |
$groupattach = $this->getAttachment($value->meta_value); |
| 937 |
self::$export_instance->data[$id][ $value->meta_key ] = $groupattach; |
| 938 |
} |
| 939 |
|
| 940 |
else{ |
| 941 |
$value->meta_key = preg_replace('/group_/','', $value->meta_key ); |
| 942 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 943 |
} |
| 944 |
} |
| 945 |
} |
| 946 |
//TYPES Allow multiple-instances of this field |
| 947 |
}elseif(!empty($group_unset) && in_array($value->meta_key, $group_unset) && is_serialized($value->meta_value)) { |
| 948 |
$unser = unserialize($value->meta_value); |
| 949 |
$data = ""; |
| 950 |
foreach ($unser as $key4 => $value4) |
| 951 |
$data .= $value4.','; |
| 952 |
self::$export_instance->data[$id][ $value->meta_key ] = substr($data, 0, -1); |
| 953 |
} |
| 954 |
elseif(!empty($pods_type) && in_array($value->meta_key , $pods_type)){ |
| 955 |
if(!isset(self::$export_instance->data[$id][$value->meta_key])){ |
| 956 |
if(in_array($optionalType , $taxonomies)){ |
| 957 |
$pods_file_data = get_term_meta($id,$value->meta_key); |
| 958 |
}else{ |
| 959 |
$pods_file_data = get_post_meta($id,$value->meta_key); |
| 960 |
} |
| 961 |
|
| 962 |
$pods_value = ''; |
| 963 |
foreach($pods_file_data as $pods_file_value){ |
| 964 |
if(!empty($pods_file_value)){ |
| 965 |
if(is_array($pods_file_value)){ |
| 966 |
$pods_file_value['post_type']=isset($pods_file_value['post_type'])?$pods_file_value['post_type']:''; |
| 967 |
$posts_type=$pods_file_value['post_type']; |
| 968 |
if($posts_type=='attachment'){ |
| 969 |
$pods_value .= $pods_file_value['guid'] . ','; |
| 970 |
} |
| 971 |
elseif($posts_type!=='attachment'){ |
| 972 |
$pods_file_value['guid']=isset($pods_file_value['guid'])?$pods_file_value['guid']:''; |
| 973 |
$p_guid=$pods_file_value['guid']; |
| 974 |
$pod_tit = $wpdb->get_results("SELECT post_title FROM {$wpdb->prefix}posts where guid='$p_guid'"); |
| 975 |
if(!empty($pod_tit)){ |
| 976 |
foreach($pod_tit as $pods_title){ |
| 977 |
$pods_title_value=$pods_title->post_title; |
| 978 |
$pods_value .= $pods_title_value . ','; |
| 979 |
} |
| 980 |
} |
| 981 |
else{ |
| 982 |
$podstaxval = $pods_file_value['name']; |
| 983 |
$pods_value .= $podstaxval. ','; |
| 984 |
} |
| 985 |
} |
| 986 |
}else{ |
| 987 |
$pods_value .= $pods_file_value . ','; |
| 988 |
} |
| 989 |
} |
| 990 |
} |
| 991 |
self::$export_instance->data[$id][$value->meta_key] = rtrim($pods_value , ','); |
| 992 |
} |
| 993 |
} |
| 994 |
|
| 995 |
elseif(is_array($metabox_fields) && array_key_exists($value->meta_key, $metabox_fields)){ |
| 996 |
$get_metabox_fieldtype = $metabox_fields[$value->meta_key]['type']; |
| 997 |
|
| 998 |
if($get_metabox_fieldtype == 'select' || $get_metabox_fieldtype == 'select_advanced' || $get_metabox_fieldtype == 'checkbox_list' || $get_metabox_fieldtype == 'text_list' || $get_metabox_fieldtype == 'file_advanced'){ |
| 999 |
|
| 1000 |
$metabox_metakey = $value->meta_key; |
| 1001 |
if($module == 'Users'){ |
| 1002 |
$get_metabox_values = $wpdb->get_results("SELECT meta_value FROM {$wpdb->prefix}usermeta WHERE meta_key = '$metabox_metakey' AND user_id = $id ", ARRAY_A); |
| 1003 |
}else if($module == 'Categories' || $module == 'Taxonomies' || $module == 'Tags'){ |
| 1004 |
$get_metabox_values = $wpdb->get_results("SELECT meta_value FROM {$wpdb->prefix}termmeta WHERE meta_key = '$metabox_metakey' AND term_id = $id ", ARRAY_A); |
| 1005 |
}else{ |
| 1006 |
$get_metabox_values = $wpdb->get_results("SELECT meta_value FROM {$wpdb->prefix}postmeta WHERE meta_key = '$metabox_metakey' AND post_id = $id ", ARRAY_A); |
| 1007 |
} |
| 1008 |
|
| 1009 |
$metabox_values = array_column($get_metabox_values, 'meta_value'); |
| 1010 |
if($get_metabox_fieldtype == 'file_advanced' || $get_metabox_fieldtype == 'image_advanced'){ |
| 1011 |
$get_metabox_file_url = []; |
| 1012 |
foreach($metabox_values as $metavalue){ |
| 1013 |
$get_metabox_file_url[] = $wpdb->get_var("SELECT guid FROM {$wpdb->prefix}posts WHERE ID = $metavalue AND post_type = 'attachment' "); |
| 1014 |
} |
| 1015 |
|
| 1016 |
$metabox_file_value = implode(',', $get_metabox_file_url); |
| 1017 |
self::$export_instance->data[$id][ $value->meta_key ] = $metabox_file_value; |
| 1018 |
} |
| 1019 |
else{ |
| 1020 |
$metabox_value = implode(',', $metabox_values); |
| 1021 |
self::$export_instance->data[$id][ $value->meta_key ] = $metabox_value; |
| 1022 |
} |
| 1023 |
} |
| 1024 |
|
| 1025 |
elseif($get_metabox_fieldtype == 'fieldset_text'){ |
| 1026 |
$fieldset_values = unserialize($value->meta_value); |
| 1027 |
$fieldset_value = implode(',', array_values($fieldset_values)); |
| 1028 |
self::$export_instance->data[$id][ $value->meta_key ] = $fieldset_value; |
| 1029 |
} |
| 1030 |
|
| 1031 |
elseif($get_metabox_fieldtype == 'post' || $get_metabox_fieldtype == 'taxonomy' || $get_metabox_fieldtype == 'user'){ |
| 1032 |
if($get_metabox_fieldtype == 'post'){ |
| 1033 |
$get_metabox_titles = $wpdb->get_var("SELECT post_title FROM {$wpdb->prefix}posts WHERE ID = $value->meta_value "); |
| 1034 |
} |
| 1035 |
elseif($get_metabox_fieldtype == 'taxonomy' || $get_metabox_fieldtype == 'taxonomy_advanced'){ |
| 1036 |
$get_metabox_titles = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}terms WHERE term_id = $value->meta_value "); |
| 1037 |
} |
| 1038 |
elseif($get_metabox_fieldtype == 'user'){ |
| 1039 |
$get_metabox_titles = $wpdb->get_var("SELECT user_login FROM {$wpdb->prefix}users WHERE ID = $value->meta_value "); |
| 1040 |
} |
| 1041 |
self::$export_instance->data[$id][ $value->meta_key ] = $get_metabox_titles; |
| 1042 |
} |
| 1043 |
|
| 1044 |
elseif($get_metabox_fieldtype == 'image' || $get_metabox_fieldtype == 'file'){ |
| 1045 |
$upload_values = $value->meta_value; |
| 1046 |
$upload_value = $wpdb->get_var("SELECT guid FROM {$wpdb->prefix}posts WHERE ID = $upload_values AND post_type = 'attachment' "); |
| 1047 |
self::$export_instance->data[$id][ $value->meta_key ] = $upload_value; |
| 1048 |
} |
| 1049 |
else{ |
| 1050 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 1051 |
} |
| 1052 |
} |
| 1053 |
|
| 1054 |
else{ |
| 1055 |
self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 1056 |
} |
| 1057 |
|
| 1058 |
// if(preg_match('/wpcf-/',$value->meta_key)){ |
| 1059 |
// $value->meta_key = preg_replace('/wpcf-/','', $value->meta_key ); |
| 1060 |
// self::$export_instance->data[$id][ $value->meta_key ] = $value->meta_value; |
| 1061 |
// } |
| 1062 |
} |
| 1063 |
} |
| 1064 |
|
| 1065 |
public function getRepeater($parent) |
| 1066 |
{ |
| 1067 |
global $wpdb; |
| 1068 |
|
| 1069 |
$get_fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts where post_parent = %d", $parent), ARRAY_A); |
| 1070 |
//$test = $get_fields[0]->ID ; |
| 1071 |
$i = 0; |
| 1072 |
foreach ($get_fields as $key => $value) { |
| 1073 |
$array[$i] = $value['post_excerpt']; |
| 1074 |
$i++; |
| 1075 |
} |
| 1076 |
|
| 1077 |
return $array; |
| 1078 |
} |
| 1079 |
|
| 1080 |
public function getRepeaterofRepeater($parent) |
| 1081 |
{ |
| 1082 |
global $wpdb; |
| 1083 |
$get_fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts where post_parent = %d", $parent), ARRAY_A); |
| 1084 |
$test = $get_fields[0]->ID ; |
| 1085 |
$get_fieldss = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->posts where post_parent = %d", $test), ARRAY_A); |
| 1086 |
$i = 0; |
| 1087 |
foreach ($get_fieldss as $key => $value) { |
| 1088 |
$array[$i] = $value['post_excerpt']; |
| 1089 |
$i++; |
| 1090 |
} |
| 1091 |
|
| 1092 |
return $array; |
| 1093 |
} |
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
/** |
| 1098 |
* Fetch all Categories |
| 1099 |
* @param $mode |
| 1100 |
* @param $module |
| 1101 |
* @param $optionalType |
| 1102 |
* @return array |
| 1103 |
*/ |
| 1104 |
public function FetchCategories($module,$optionalType,$mode = null) { |
| 1105 |
$headers = self::$export_instance->generateHeaders($module, $optionalType); |
| 1106 |
$get_all_terms = get_categories('hide_empty=0'); |
| 1107 |
self::$export_instance->totalRowCount = count($get_all_terms); |
| 1108 |
if(!empty($get_all_terms)) { |
| 1109 |
foreach( $get_all_terms as $termKey => $termValue ) { |
| 1110 |
$termID = $termValue->term_id; |
| 1111 |
$termName = $termValue->cat_name; |
| 1112 |
$termSlug = $termValue->slug; |
| 1113 |
$termDesc = $termValue->category_description; |
| 1114 |
$termParent = $termValue->parent; |
| 1115 |
if($termParent == 0) { |
| 1116 |
self::$export_instance->data[$termID]['name'] = $termName; |
| 1117 |
} else { |
| 1118 |
$termParentName = get_cat_name( $termParent ); |
| 1119 |
self::$export_instance->data[$termID]['name'] = $termParentName . '|' . $termName; |
| 1120 |
} |
| 1121 |
self::$export_instance->data[$termID]['slug'] = $termSlug; |
| 1122 |
self::$export_instance->data[$termID]['description'] = $termDesc; |
| 1123 |
self::$export_instance->data[$termID]['parent'] = $termParent; |
| 1124 |
self::$export_instance->data[$termID]['TERMID'] = $termID; |
| 1125 |
|
| 1126 |
self::$export_instance->getWPMLData($termID,$optionalType,$module); |
| 1127 |
|
| 1128 |
$this->getPostsMetaDataBasedOnRecordId ($termID, $module, $optionalType); |
| 1129 |
|
| 1130 |
if(in_array('wordpress-seo/wp-seo.php', self::$export_instance->get_active_plugins())) { |
| 1131 |
$seo_yoast_taxonomies = get_option( 'wpseo_taxonomy_meta' ); |
| 1132 |
if ( isset( $seo_yoast_taxonomies['category'] ) ) { |
| 1133 |
|
| 1134 |
self::$export_instance->data[ $termID ]['title'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_title']; |
| 1135 |
self::$export_instance->data[ $termID ]['meta_desc'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_desc']; |
| 1136 |
self::$export_instance->data[ $termID ]['canonical'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_canonical']; |
| 1137 |
self::$export_instance->data[ $termID ]['bctitle'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_bctitle']; |
| 1138 |
self::$export_instance->data[ $termID ]['meta-robots-noindex'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_noindex']; |
| 1139 |
self::$export_instance->data[ $termID ]['sitemap-include'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_sitemap_include']; |
| 1140 |
self::$export_instance->data[ $termID ]['opengraph-title'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_opengraph-title']; |
| 1141 |
self::$export_instance->data[ $termID ]['opengraph-description'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_opengraph-description']; |
| 1142 |
self::$export_instance->data[ $termID ]['opengraph-image'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_opengraph-image']; |
| 1143 |
self::$export_instance->data[ $termID ]['twitter-title'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_twitter-title']; |
| 1144 |
self::$export_instance->data[ $termID ]['twitter-description'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_twitter-description']; |
| 1145 |
self::$export_instance->data[ $termID ]['twitter-image'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_twitter-image']; |
| 1146 |
self::$export_instance->data[ $termID ]['focus_keyword'] = $seo_yoast_taxonomies['category'][$termID]['wpseo_focuskw']; |
| 1147 |
|
| 1148 |
} |
| 1149 |
} |
| 1150 |
} |
| 1151 |
} |
| 1152 |
$result = self::$export_instance->finalDataToExport(self::$export_instance->data, $module); |
| 1153 |
|
| 1154 |
if($mode == null){ |
| 1155 |
self::$export_instance->proceedExport($result); |
| 1156 |
}else{ |
| 1157 |
return $result; |
| 1158 |
} |
| 1159 |
} |
| 1160 |
|
| 1161 |
|
| 1162 |
public function get_common_post_metadata($meta_id){ |
| 1163 |
global $wpdb; |
| 1164 |
$mdata = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) ,ARRAY_A); |
| 1165 |
return $mdata[0]; |
| 1166 |
} |
| 1167 |
|
| 1168 |
public function getAttachment($id) |
| 1169 |
{ |
| 1170 |
global $wpdb; |
| 1171 |
$get_attachment = $wpdb->prepare("select guid from $wpdb->posts where ID = %d AND post_type = %s", $id, 'attachment'); |
| 1172 |
$attachment = $wpdb->get_results($get_attachment); |
| 1173 |
$attachment_file = $attachment[0]->guid; |
| 1174 |
return $attachment_file; |
| 1175 |
|
| 1176 |
} |
| 1177 |
|
| 1178 |
/** |
| 1179 |
* Fetch all Tags |
| 1180 |
* @param $mode |
| 1181 |
* @param $module |
| 1182 |
* @param $optionalType |
| 1183 |
* @return array |
| 1184 |
*/ |
| 1185 |
public function FetchTags($module,$optionalType,$mode = null) { |
| 1186 |
self::$export_instance->generateHeaders($module, $optionalType); |
| 1187 |
$get_all_terms = get_tags('hide_empty=0'); |
| 1188 |
self::$export_instance->totalRowCount = count($get_all_terms); |
| 1189 |
if(!empty($get_all_terms)) { |
| 1190 |
foreach( $get_all_terms as $termKey => $termValue ) { |
| 1191 |
$termID = $termValue->term_id; |
| 1192 |
$termName = $termValue->name; |
| 1193 |
$termSlug = $termValue->slug; |
| 1194 |
$termDesc = $termValue->description; |
| 1195 |
self::$export_instance->data[$termID]['name'] = $termName; |
| 1196 |
self::$export_instance->data[$termID]['slug'] = $termSlug; |
| 1197 |
self::$export_instance->data[$termID]['description'] = $termDesc; |
| 1198 |
|
| 1199 |
$this->getPostsMetaDataBasedOnRecordId ($termID, $module, $optionalType); |
| 1200 |
self::$export_instance->getWPMLData($termID,$optionalType,$module); |
| 1201 |
if(in_array('wordpress-seo/wp-seo.php', self::$export_instance->get_active_plugins())) { |
| 1202 |
$seo_yoast_taxonomies = get_option( 'wpseo_taxonomy_meta' ); |
| 1203 |
if ( isset( $seo_yoast_taxonomies['post_tag'] ) ) { |
| 1204 |
|
| 1205 |
self::$export_instance->data[ $termID ]['title'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_title']; |
| 1206 |
self::$export_instance->data[ $termID ]['meta_desc'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_desc']; |
| 1207 |
self::$export_instance->data[ $termID ]['canonical'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_canonical']; |
| 1208 |
self::$export_instance->data[ $termID ]['bctitle'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_bctitle']; |
| 1209 |
self::$export_instance->data[ $termID ]['meta-robots-noindex'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_noindex']; |
| 1210 |
self::$export_instance->data[ $termID ]['sitemap-include'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_sitemap_include']; |
| 1211 |
self::$export_instance->data[ $termID ]['opengraph-title'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_opengraph-title']; |
| 1212 |
self::$export_instance->data[ $termID ]['opengraph-description'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_opengraph-description']; |
| 1213 |
self::$export_instance->data[ $termID ]['opengraph-image'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_opengraph-image']; |
| 1214 |
self::$export_instance->data[ $termID ]['twitter-title'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_twitter-title']; |
| 1215 |
self::$export_instance->data[ $termID ]['twitter-description'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_twitter-description']; |
| 1216 |
self::$export_instance->data[ $termID ]['twitter-image'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_twitter-image']; |
| 1217 |
self::$export_instance->data[ $termID ]['focus_keyword'] = $seo_yoast_taxonomies['post_tag'][$termID]['wpseo_focuskw']; |
| 1218 |
|
| 1219 |
} |
| 1220 |
} |
| 1221 |
} |
| 1222 |
} |
| 1223 |
|
| 1224 |
$result = self::$export_instance->finalDataToExport(self::$export_instance->data, $module); |
| 1225 |
if($mode == null) |
| 1226 |
self::$export_instance->proceedExport($result); |
| 1227 |
else |
| 1228 |
return $result; |
| 1229 |
} |
| 1230 |
} |
| 1231 |
|
| 1232 |
global $post_export_class; |
| 1233 |
$post_export_class = new PostExport(); |
| 1234 |
|