HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ubuntu-8gb-hel1-1 6.8.0-55-generic #57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /var/www/agighana.org_backup/download-link.php
<?php
namespace Elementor\App\Modules\KitLibrary\Data\Kits\Endpoints;

use Elementor\Data\V2\Base\Endpoint;
use Elementor\App\Modules\KitLibrary\Data\Kits\Controller;

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

/**
 * @property Controller $controller
 */
class Download_Link extends Endpoint {
	public function get_name() {
		return 'download-link';
	}

	public function get_format() {
		return 'kits/download-link/{id}';
	}

	protected function register() {
		$this->register_item_route( \WP_REST_Server::READABLE, [
			'id_arg_type_regex' => '[\w]+',
		] );
	}

	public function get_item( $id, $request ) {
		$repository = $this->controller->get_repository();
		$data = $repository->get_download_link( $id );

		return [
			'data' => $data,
			'meta' => [
				'nonce' => wp_create_nonce( 'kit-library-import' ),
			],
		];
	}
}