# elementor/3.34.3/app/modules/import-export-customization/data/response.php

Elementor Website Builder – more than just a page builder, version 3.34.3. 39 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.34.3/code/app/modules/import-export-customization/data/response.php
- Raw: https://pluginprobe.com/plugins/elementor/3.34.3/raw/app/modules/import-export-customization/data/response.php
- Modified: 2025-10-27T10:18:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/3.34.3/code/app/modules/import-export-customization/data/response.php#L10-L20`.

```php
<?php

namespace Elementor\App\Modules\ImportExportCustomization\Data;

class Response {
	private array $data;
	private array $meta;

	public function __construct( array $data, array $meta = [] ) {
		$this->data = $data;
		$this->meta = $meta;
	}

	public static function success( array $data, array $meta = [] ): \WP_REST_Response {
		$response = new self( $data, $meta );
		return $response->to_wp_rest_response( 200 );
	}

	public static function error( string $code, $message, array $meta = [] ): \WP_REST_Response {
		$response = new self([
			'code' => $code,
			'message' => $message,
		], $meta);

		return $response->to_wp_rest_response( 500 );
	}

	private function to_array(): array {
		return [
			'data' => $this->data,
			'meta' => $this->meta,
		];
	}

	private function to_wp_rest_response( int $status_code = 200 ): \WP_REST_Response {
		return new \WP_REST_Response( $this->to_array(), $status_code );
	}
}

```
