wpseek.com
A WordPress-centric search engine for devs and theme authors



get_allowed_http_origins › WordPress Function

Since3.4.0
Deprecatedn/a
get_allowed_http_origins ( No parameters )
Returns:
  • (string[]) Array of origin URLs.
Defined at:
Codex:

Retrieves list of allowed HTTP origins.



Source

function get_allowed_http_origins() {
	$admin_origin = parse_url( admin_url() );
	$home_origin  = parse_url( home_url() );

	// @todo Preserve port?
	$allowed_origins = array_unique(
		array(
			'http://' . $admin_origin['host'],
			'https://' . $admin_origin['host'],
			'http://' . $home_origin['host'],
			'https://' . $home_origin['host'],
		)
	);

	/**
	 * Changes the origin types allowed for HTTP requests.
	 *
	 * @since 3.4.0
	 *
	 * @param string[] $allowed_origins Array of allowed HTTP origins.
	 */
	return apply_filters( 'allowed_http_origins', $allowed_origins );
}