I'd like to have the "Enable Affiliate Links" option

Hello. I'd like to have the "Enable Affiliate Links" option ON by default for newly created blogs:

How would I do that?

  • chipit_prom
    • Site Builder, Child of Zeus

    Thanks. I took a look at the code, and it looks like for that option to be ON, I need to.

    1) mark the 'enable_affiliate' option as 'yes' and
    2) build an affiliate reference for the user.

    I did that with the following code:

    // and turn on their very own affiliate option
    update_user_meta($user->ID, 'enable_affiliate', 'yes');
    $reference = aff_build_reference( $user );
    update_user_meta($user->ID, 'affiliate_reference', $reference);
    update_user_meta($user->ID, 'affiliate_hash', 'aff' . md5(AUTH_SALT . $reference));

    Though, I'd like the get the developer's feedback on this to see if it's indieed correct.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.