HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: /home/mirz4654/www/wp-content/plugins/elementor-pro/modules/query-control/controls/query.php
<?php

namespace ElementorPro\Modules\QueryControl\Controls;

use Elementor\Control_Select2;
use ElementorPro\Modules\QueryControl\Module;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

class Query extends Control_Select2 {

	public function get_type() {
		return 'query';
	}

	/**
	 * 'query' can be used for passing query args in the structure and format used by WP_Query.
	 * @return array
	 */
	protected function get_default_settings() {
		return array_merge(
			parent::get_default_settings(), [
				'query' => '',
			]
		);
	}

	/**
	 * Update control settings using mapping config
	 *
	 * @param $value
	 * @param array $control_args
	 * @param array $config
	 *
	 * @return mixed
	 */
	public function on_import_update_settings( $value, array $control_args, array $config ) {
		switch ( $control_args['autocomplete']['object'] ) {
			case Module::QUERY_OBJECT_POST:
			case Module::QUERY_OBJECT_LIBRARY_TEMPLATE:
				return $this->replace_id_from_mapping( $value, $config['post_ids'] );
			case Module::QUERY_OBJECT_TAX:
				return $this->replace_id_from_mapping( $value, $config['term_ids'] );
			default:
				return $value;
		}
	}

	/**
	 * replace id from config
	 *
	 * @param mixed $value
	 * @param array $mapping
	 *
	 * @return string
	 */
	private function replace_id_from_mapping( $value, array $mapping ): string {
		return $mapping[ $value ] ?? $value;
	}

}