wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
wp_send_document_isolation_policy_header › WordPress Function
Da7.2.0
Deprecaton/a
› wp_send_document_isolation_policy_header ( Nessun parametro )
| Ritorna: |
|
| Definito a: |
|
| Codex: |
Sends the Document-Isolation-Policy header for cross-origin isolation.
Theisolate-and-credentialless directive loads cross-origin subresources
without credentials instead of blocking them, so no crossorigin attribute
is needed on scripts, styles, images, audio, or video for the page to work.
Forcing crossorigin="anonymous" would turn those into CORS requests
and break any resource served without Access-Control-Allow-Origin.
Sending the header also opts the screen's media frames into client-side
uploads, so call this before wp_enqueue_media() runs.Sorgenti
function wp_send_document_isolation_policy_header(): bool {
global $_wp_cross_origin_isolated;
if ( headers_sent() || ! wp_is_document_isolation_policy_supported() ) {
return false;
}
header( 'Document-Isolation-Policy: isolate-and-credentialless' );
$_wp_cross_origin_isolated = true;
return true;
}