wp_admin_headers()
Sends a referrer policy header so referrers are not sent externally from administration screens.
Hooks from the function
Returns
null. Nothing (null).
Usage
wp_admin_headers();
Changelog
| Since 4.9.0 | Introduced. |
| Since 6.8.0 | This function was moved from wp-admin/includes/misc.php to wp-includes/functions.php. |
wp_admin_headers() wp admin headers code WP 7.0
function wp_admin_headers() {
$policy = 'strict-origin-when-cross-origin';
/**
* Filters the admin referrer policy header value.
*
* @since 4.9.0
* @since 4.9.5 The default value was changed to 'strict-origin-when-cross-origin'.
*
* @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referrer-Policy
*
* @param string $policy The admin referrer policy header value. Default 'strict-origin-when-cross-origin'.
*/
$policy = apply_filters( 'admin_referrer_policy', $policy );
header( sprintf( 'Referrer-Policy: %s', $policy ) );
}