WP_Customize_Manager::filter_iframe_security_headers() WordPress Method
The WP_Customize_Manager::filter_iframe_security_headers() method is used to filter the security headers for iframes in the Customizer. This is necessary to allow iframes to be used in the Customizer for live previews.
WP_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.
Contents
Parameters
- $headers
(array)(Required)Headers.
Return
(array) Headers.
Source
File: wp-includes/class-wp-customize-manager.php
public function filter_iframe_security_headers( $headers ) { $headers['X-Frame-Options'] = 'SAMEORIGIN'; $headers['Content-Security-Policy'] = "frame-ancestors 'self'"; return $headers; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |