GC_Customize_Manager::filter_iframe_security_headers()

最后更新于:2021-11-27 00:55:04

GC_Customize_Manager::filter_iframe_security_headers( array$headers)

Filters the X-Frame-Options and Content-Security-Policy headers to ensure frontend can load in customizer.

参数

$headers

(array) (Required) Headers.

响应

(array) Headers.

源文件

文件: gc-includes/class-gc-customize-manager.php

	public function filter_iframe_security_headers( $headers ) {
		$headers['X-Frame-Options']         = 'SAMEORIGIN';
		$headers['Content-Security-Policy'] = "frame-ancestors 'self'";
		return $headers;
	}