# elementor/4.0.9/core/utils/api/response-builder.php

Elementor Website Builder – more than just a page builder, version 4.0.9. 48 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.0.9/code/core/utils/api/response-builder.php
- Raw: https://pluginprobe.com/plugins/elementor/4.0.9/raw/core/utils/api/response-builder.php
- Modified: 2025-10-21T12:51:06+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/4.0.9/code/core/utils/api/response-builder.php#L10-L20`.

```php
<?php

namespace Elementor\Core\Utils\Api;

class Response_Builder {
	private $data;
	private int $status;
	private array $meta = [];

	const NO_CONTENT = 204;

	private function __construct( $data, $status ) {
		$this->data = $data;
		$this->status = $status;
	}

	public static function make( $data = null, $status = 200 ) {
		return new self( $data, $status );
	}

	public function set_meta( array $meta ) {
		$this->meta = $meta;

		return $this;
	}

	public function set_status( int $status ) {
		$this->status = $status;

		return $this;
	}

	public function no_content() {
		return $this->set_status( static::NO_CONTENT );
	}

	public function build() {
		$res_data = static::NO_CONTENT === $this->status
			? null
			: [
				'data' => $this->data,
				'meta' => $this->meta,
			];

		return new \WP_REST_Response( $res_data, $this->status );
	}
}

```
