WP_Customize_Manager::filter_iframe_security_headers( array $headers ): array

In this article

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

Parameters

$headersarrayrequired
Headers.

Return

array Headers.

Source

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

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.