Skip to content

Commit e84908b

Browse files
committed
fixup! wp_headers filter -> send_headers action
1 parent 41b58b4 commit e84908b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

themes/jquery/functions.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function jq_image_posted_on() {
255255
/**
256256
* Content Security Policy
257257
*/
258-
function jq_content_security_policy( $headers ) {
258+
function jq_content_security_policy() {
259259
$nonce = bin2hex( random_bytes( 8 ) );
260260
$policy = array(
261261
'default-src' => "'self'",
@@ -285,9 +285,7 @@ function jq_content_security_policy( $headers ) {
285285
$policy_string .= $key . ' ' . $value . '; ';
286286
}
287287

288-
$headers[] = 'Content-Security-Policy: ' . $policy_string;
289-
290-
return $headers;
288+
header( 'Content-Security-Policy: ' . $policy_string );
291289
}
292290

293-
add_filter( 'wp_headers', 'jq_content_security_policy' );
291+
add_action( 'send_headers', 'jq_content_security_policy' );

0 commit comments

Comments
 (0)