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/include/plugins-compat.php
<?php

/*
 * manages compatibility with 3rd party plugins (and themes)
 * this class is available as soon as the plugin is loaded
 * code borrowed from Polylang
 *
 * @since 1.0.6
 */
class Lingotek_Plugins_Compat {
	static protected $instance;

	protected function __construct() {
		// WordPress Importer
		add_action('init', array(&$this, 'lingotek_maybe_wordpress_importer'));
	}

	static public function instance() {
		if (empty(self::$instance))
			self::$instance = new self();

		return self::$instance;
	}

	function lingotek_maybe_wordpress_importer() {
		if (defined('WP_LOAD_IMPORTERS') && class_exists('WP_Import')) {
			remove_action('admin_init', 'lingotek_wordpress_importer_init');
			add_action('admin_init', array(&$this, 'lingotek_wordpress_importer_init'));
		}
	}

	function lingotek_wordpress_importer_init() {
		$class = new ReflectionClass('WP_Import');
		load_plugin_textdomain( 'wordpress-importer', false, basename(dirname( $class->getFileName() )) . '/languages' );

		$GLOBALS['wp_import'] = new Lingotek_WP_Import();
		register_importer( 'wordpress', 'WordPress', __('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'), array( $GLOBALS['wp_import'], 'dispatch' ) );
	}
}
?>