Last active
November 18, 2019 16:03
-
-
Save twfahey1/cfbd1779a27f3474e4c9a2c1315b2ce2 to your computer and use it in GitHub Desktop.
Wordpress - Manipulate headers programmatically in plugin / theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_header_auth( $headers ) { | |
if ( ! is_admin() ) { | |
$headers['X-Frame-Options'] = 'SAMEORIGIN'; | |
} | |
return $headers; | |
} | |
add_filter( 'wp_headers', 'add_header_auth' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment