• Hi there,

    I’m wondering if someone might know where to add php code to registration.

    I have the code already, I just would like to know which file and perhaps where it should be added to execute during registration.

    Basically it adds some user data in the usermeta, I would like to execute it at the same time the new user hits the REGISTRATION BUTTON.

    Any help would be very very much appreciated – THX =)

    The code is below in case you need to know.

    //______________________________________GET COOKIE START________________________________
    	$user_refer = $_COOKIE['referrer'] ; //If user does not register now this will get the cookie info later
    	if (empty($user_refer)) { //if cookie empty do nothing
    	echo ''; }
    
    	else  //if cookie has value do this
    
    	//global $wpdb;
    	$refer_metaid = get_usermeta($user_refer,'Refered');
    	$points = get_usermeta($user_refer, POINTS);
    	$new_user_info = get_userdatabylogin( $user_name );
    	$new_user_id = $new_user_info->ID;
    
    	$ref_points = 25; //amount of points from referring
    	$refer_info = get_userdata($user_refer);
    	$refer_username = $refer_info->user_login;
    
    	update_usermeta($user_refer,'Refered',$refer_metaid . $user_name . '<br />');
    	update_usermeta($new_user_id,'Sponsor',$refer_username);
        if ($points < 0) {
    	  $points = 0;}
    	update_usermeta($user_refer, POINTS, $points + $ref_points);
    	//__________________________________________END OF GET COOKIE____________________________________
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where to add code to execute during registration’ is closed to new replies.