Api_Server::add_api_headers( array $args, string $request_url )

Method add_api_headers


Parameters Parameters

$args

(Required)

$request_url

(Required)


Top ↑

Return Return

(array)


Source Source

File: src/core/classes/class-api-server.php

	public function add_api_headers( $args, $request_url ) {

		$license_key = self::get_license_key();

		if ( ! $license_key ) {
			return $args;
		}

		// If the request URL starts with the Automator API url
		if ( substr( $request_url, 0, strlen( self::$url ) ) === self::$url ) {
			$args['headers']['license-key'] = $license_key;
			$args['headers']['site-name']   = self::get_site_name();
			$args['headers']['item-name']   = self::get_item_name();
		}

		return $args;
	}