HEX
Server: LiteSpeed
System: Linux s166.bitcommand.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: h340499 (1922)
PHP: 8.2.16
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/h340499/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/import-xml.php
<?php

global $pagenow;
$filtered_import = filter_input( INPUT_GET, 'import',FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE );
$filtered_step   = filter_input( INPUT_GET, 'step',FILTER_SANITIZE_FULL_SPECIAL_CHARS, FILTER_NULL_ON_FAILURE );

if ($pagenow == 'admin.php' && 0 === strcmp( $filtered_import, 'wordpress' ) && $filtered_step == 1 ) {
	add_action('admin_head', 'icl_import_xml');
}

function icl_import_xml() {
	global $sitepress;
	$langs = $sitepress->get_active_languages();
	if (empty($langs)) {
		return;
	}
	$default = $sitepress->get_default_language();
	
		$out = '<h3>' . esc_html__('Select Language', 'sitepress') . '</h3><p><select name="icl_post_language">';
		foreach ($langs as $lang) {
			$out .= '<option value="' . esc_attr( $lang['code'] ) . '"';
			if ($default == $lang['code']) {
				$out .= ' selected="selected"';
			}
			$out .= '>' . esc_html( $lang['native_name'] ) . '<\/option>';
		}
		$out .= '<\/select><\/p>';
	
	echo '
	<script type="text/javascript">
		jQuery(document).ready(function(){
			jQuery("#wpbody-content").find("form .submit").before(\'' . $out . '\');
		});
	</script>
	';
}

add_action('import_start', 'icl_import_xml_start', 0);
function icl_import_xml_start() {
	set_time_limit( 0 );
	$post_languages = isset( $_POST['icl_post_language'] ) ? $_POST['icl_post_language'] : array();

	$_POST['icl_tax_post_tag_language'] = $_POST['icl_tax_category_language'] = $_POST['icl_tax_language'] = $post_languages;
}