HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpicare/wp-content/plugins/elementor-pro/modules/global-widget/data/controller.php
<?php
namespace ElementorPro\Modules\GlobalWidget\Data;

use Elementor\Data\Base\Controller as Controller_Base;
use ElementorPro\Plugin;

class Controller extends Controller_Base {

	public function get_name() {
		return 'global-widget/templates';
	}

	public function register_endpoints() {} // No endpoints.

	// TODO: After merging with 'REST API V2' add `get_collection_params`.
	public function get_items( $request ) {
		$result = [];
		$ids = $request->get_param( 'ids' );

		if ( ! empty( $ids ) ) {
			// TODO: This logic should be handled at REST API.
			$ids = explode( ',', $ids );

			foreach ( $ids as $template_id ) {
				$template_data = Plugin::elementor()->templates_manager->get_template_data( [
					'source' => 'local',
					'template_id' => $template_id,
				] );

				if ( ! empty( $template_data ) ) {
					$result[ $template_id ] = $template_data['content'][0];
				}
			}
		}

		return $result;
	}

	public function get_permission_callback( $request ) {
		return current_user_can( 'edit_posts' );
	}
}