HEX
Server: Apache
System: Linux sxb1plmcpnl510113.prod.sxb1.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: acnbijigo78q (10488831)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/acnbijigo78q/public_html/jetk.sa/wp-content/plugins/wpml-import/classes/EarlyHooks.php
<?php

namespace WPML\Import;

/**
 * These class is loaded on `plugin_loaded` so we
 * should rely on WPML yet, and our class autoloader
 * is not set yet.
 *
 * We should keep this class with the minimal code.
 */
class EarlyHooks {

	/**
	 * @return void
	 */
	public static function init() {
		if ( self::isImportScreen() ) {
			add_filter( 'wpml_show_admin_language_switcher', '__return_false' );
		}
	}

	/**
	 * @return bool
	 */
	private static function isImportScreen() {
		if ( ! is_admin() ) {
			return false;
		}

		$query = isset( $_SERVER['REQUEST_URI'] ) ? wp_parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) : [];

		if ( $query ) {
			parse_str( $query, $queryArgs );

			if ( isset( $queryArgs['page'] ) && WPML_IMPORT_ADMIN_PAGE_SLUG === $queryArgs['page'] ) {
				return true;
			}
		}

		return false;
	}
}