Created
March 20, 2018 17:27
-
-
Save mohsinrasool/9e586ffdf9388ece201f9e93744a9056 to your computer and use it in GitHub Desktop.
WordPress Fix for soft SSL provided by Cloudflare
This file contains hidden or 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
<?php | |
/** | |
* Add following snippet in functions.php of your active theme. it should fix both admin and frontend. | |
*/ | |
function ms_admin_head() { | |
echo '<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">'; | |
} | |
add_action( 'admin_print_styles', 'ms_admin_head', 1 ); | |
add_action( 'wp_head', 'ms_admin_head', 1 ); | |
add_action( 'login_enqueue_scripts', 'ms_admin_head', 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment