wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_send_document_isolation_policy_header › WordPress Function
Desde7.2.0
Obsoleton/a
› wp_send_document_isolation_policy_header ( Sem parâmetros )
| Retorna: |
|
| Definido em: |
|
| 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.Fonte
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;
}