myCred 후크 중 '추천을 위한 포인트' 사용법 문의

1. 정확한 제품 또는 플러그인 이름

코스모스팜 회원관리

마이크레드

 

2. 상세 내용

안녕하세요. 마이크레드 후크 메뉴에 들어가면 KBoard 게시글 및 댓글 작성 등 다양한 훅들을 설정할 수 있는데요.

그 중에서 '추천을 위한 포인트'가 있는데, 이것을 설정해도 레퍼럴 링크를 통한 가입 시 포인트 지급이 되지 않습니다.

일단 아래처럼 설정해놓은 상태인데요. 확인 부탁드립니다.

 

https://imgur.com/a/FJrcTRs

 

만약 wp-members 필드에 특정 필드를 추가해야 된다면 안내 부탁드립니다.

아래에 myCred 관련 코드를 첨부합니다.(plugins/mycred/includes/hooks)

		public function site_signup( $new_user_id ) {

			// Requirement
			$ref = false;
			$key = '';
			if ( isset( $_COOKIE[ 'signup_ref' . $this->mycred_type ] ) ) {
				$ref = sanitize_text_field( wp_unslash( $_COOKIE[ 'signup_ref' . $this->mycred_type ] ) );
				$key = 'signup_ref' . $this->mycred_type;
			}
			elseif ( isset( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) ) {
				$ref = sanitize_text_field( wp_unslash( $_COOKIE[ 'mycred_ref' . $this->mycred_type ] ) );
				$key = 'mycred_ref' . $this->mycred_type;
			}

			if ( $ref === false ) return;

			// Attempt to get the user id based on the referrer
			$user_id = $this->get_user_id_from_ref_id( $ref );
			if ( $user_id === NULL ) {

				if ( ! headers_sent() )
					setcookie( $key, $ref, time()-3600, COOKIEPATH, COOKIE_DOMAIN );

				return;

			}

			// Delete Cookie
			if ( ! headers_sent() )
				setcookie( $key, $ref, time()-3600, COOKIEPATH, COOKIE_DOMAIN );

			

			// Attempt to get the users IP
			$remote_addr = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
			$IP = sanitize_key( apply_filters( 'mycred_affiliate_IP', $remote_addr, 'signup', $this ) );

			if ( $this->core->has_entry( 'signup_referral', $new_user_id, $user_id, $IP, $this->mycred_type ) ) return;


			if ( $IP != '' && $IP != '0.0.0.0' ) {

				if ( $this->core->has_entry( 'signup_referral', $new_user_id, $user_id, $IP, $this->mycred_type ) ) return;

				if ( $this->ref_counts( $user_id, $IP, 'signup' ) ) {

					// Award when users account gets activated
					if ( function_exists( 'buddypress' ) || class_exists( 'pw_new_user_approve' ) ) {

						mycred_add_user_meta( $new_user_id, 'referred_by_', $this->mycred_type, $user_id, true );
						mycred_add_user_meta( $new_user_id, 'referred_by_IP_', $this->mycred_type, $IP, true );
						mycred_add_user_meta( $new_user_id, 'referred_by_type_', $this->mycred_type, $this->mycred_type, true );

					}
					// Award now
					else {

						$execute = apply_filters( 'mycred_signup_referral_execute_woo', true,  $user_id, $IP, $new_user_id , $this );

						if ( $this->core->has_entry( 'signup_referral', $new_user_id, $user_id, $IP, $this->mycred_type ) ) return;

	                    if ( $execute === true ) {
							$this->core->add_creds(
								'signup_referral',
								$user_id,
								$this->prefs['signup']['creds'],
								$this->prefs['signup']['log'],
								$new_user_id,
								$IP,
								$this->mycred_type
							);

						}

						do_action( 'mycred_signup_referral', $user_id, $IP, $new_user_id, $this );

					}

				}

			}

		}

 

좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기