Created
November 8, 2017 09:59
-
-
Save spacedmonkey/11405ce22c3ccbea0683fefcc7f1a21b to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Force cookie constants to be local domain / path | |
* after multisite is loaded. | |
*/ | |
add_action( | |
'ms_loaded', function () { | |
$site = get_site(); | |
define( 'COOKIE_DOMAIN', $site->domain ); | |
define( 'COOKIE_PATH', $site->path ); | |
define( 'SITECOOKIEPATH', $site->path ); | |
define( 'COOKIEHASH', md5( $site->domain . $site->path ) ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment