Created
August 3, 2016 13:09
-
-
Save JudeRosario/14a690a739132dabdb04113861f329b0 to your computer and use it in GitHub Desktop.
Affiliates + MP + Multisite
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
add_action( 'wp_footer', function(){ | |
if( isset( $_COOKIE['affiliate_' . COOKIEHASH] ) ) { | |
$reference = isset($_GET['ref'])?$_GET['ref']:false; | |
@setcookie('affiliate_' . COOKIEHASH, 'aff' . md5(AUTH_SALT . $reference), | |
(time() + (60 * 60 * 24 * ((int) AFFILIATE_COOKIE_DAYS ))), | |
COOKIEPATH, | |
COOKIE_DOMAIN | |
); | |
} | |
}) ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment