send_frame_options_header()

Sends a HTTP header to limit rendering of pages to same origin iframes.

Description

See also

Source

function send_frame_options_header() {
	if ( ! headers_sent() ) {
		header( 'X-Frame-Options: SAMEORIGIN' );
		header( "Content-Security-Policy: frame-ancestors 'self';" );
	}
}

Changelog

VersionDescription
3.1.3Introduced.

User Contributed Notes

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