HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: /volume1/web/wp-content/plugins.hold/lingotek-translation/admin/wp-import.php
<?php

/**
 * Fires before WordPress Importer to remove Lingotek metadata so Lingotek can track posts correctly
 *
 * @since 1.0.6
 */
class Lingotek_WP_Import extends PLL_WP_Import {

	/**
	 * Removes post_translations metadata if no translations exist so it doesn't get put in the database by WP_Import
	 *
	 * @since 1.0.6
	 */
	public function process_posts() {
		if (empty($this->post_translations)) {
			foreach ($this->posts as &$post) {
				foreach ($post['terms'] as $key => &$term) {
					if (!empty($post['terms'])) {
						if (in_array('post_translations', $term)) {
							unset($post['terms'][$key]);
						}
					}
				}
			}
		}
		parent::process_posts();
	}
}

?>