Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Affiliates + MP + Multisite
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
You can’t perform that action at this time.