<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[myCred 후크 중 '추천을 위한 포인트' 사용법 문의]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/63206</link>
		<description><![CDATA[<p><strong>1. 정확한 제품 또는 플러그인 이름</strong></p>

<p>코스모스팜 회원관리</p>

<p>마이크레드</p>

<p> </p>

<p><strong>2. 상세 내용</strong></p>

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

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

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

<p> </p>

<p><a href="https://imgur.com/a/FJrcTRs" target="_blank">https://imgur.com/a/FJrcTRs</a></p>

<p> </p>

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

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

<pre>
<code class="language-php">		public function site_signup( $new_user_id ) {

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

			if ( $ref === false ) return;

			// Attempt to get the user id based on the referrer
			$user_id = $this-&gt;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-&gt;core-&gt;has_entry( 'signup_referral', $new_user_id, $user_id, $IP, $this-&gt;mycred_type ) ) return;


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

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

				if ( $this-&gt;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-&gt;mycred_type, $user_id, true );
						mycred_add_user_meta( $new_user_id, 'referred_by_IP_', $this-&gt;mycred_type, $IP, true );
						mycred_add_user_meta( $new_user_id, 'referred_by_type_', $this-&gt;mycred_type, $this-&gt;mycred_type, true );

					}
					// Award now
					else {

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

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

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

						}

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

					}

				}

			}

		}</code></pre>

<p> </p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[쿠키의 캐시 기능 때문이었습니다. 잘 해결했습니다. 감사합니다.^^]]></title>
			<link>https://www.cosmosfarm.com/threads/document/63347</link>
			<description><![CDATA[<p>쿠키의 캐시 기능 때문이었습니다. 잘 해결했습니다. 감사합니다.^^</p>]]></description>
			<author>메타마인드</author>
			<pubDate>Wed, 22 Feb 2023 16:32:04 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[어필리에이트 시스템을 원하시는 거라면

남겨주신 내용이 맞는듯 합니다.

 

안되는 이유는 여러가지...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/63307</link>
			<description><![CDATA[<p>어필리에이트 시스템을 원하시는 거라면</p>

<p>남겨주신 내용이 맞는듯 합니다.</p>

<p> </p>

<p>안되는 이유는 여러가지가 있을 수 있기 때문에</p>

<p>딱 잘라서 말씀드리기가 어렵습니다.</p>

<p> </p>

<p>코드로 봤을 때는 어필리에이트 링크 접속 후</p>

<p>F12를 눌러 개발자도구에서 애플리케이션-&gt;쿠키에 접속하신 후</p>

<p>signup_ref 또는 mycred_ref 이라는 키의 쿠키가 저장되어 있는지</p>

<p>확인해보시고 있다면 mycred_add 함수가 왜 동작하지 않는지 먼저 파악해주셔야 할 듯 합니다.</p>

<p> </p>

<p>맨 아래에 mycred_signup_referral 액션이 있으니</p>

<pre>
<code>add_action('mycred_signup_referral', function($user_id, $IP, $new_user_id, $data){
	echo $user_id;
	exit;
}, 10, 4);</code></pre>

<p>와 같이 사용자 ID를 확인하여</p>

<p>해당 코드가 정상적으로 동작하고 있는지도 확인 해보시겠어요?</p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Tue, 21 Feb 2023 09:17:44 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[혹시 추천인 링크를 타고 들어오면 해당 추천인에게 포인트가 지급되는

어필리에이트 시스템을 원하시...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/63263</link>
			<description><![CDATA[<p>혹시 추천인 링크를 타고 들어오면 해당 추천인에게 포인트가 지급되는</p>

<p>어필리에이트 시스템을 원하시는 걸까요?</p>

<p> </p>

<p>네, 맞습니다. 추천인 링크를 타고 들어와서 회원가입 시, 추천링크를 준 회원에게 포인트를 지급하고 싶습니다.</p>]]></description>
			<author>메타마인드</author>
			<pubDate>Wed, 15 Feb 2023 14:03:34 +0000</pubDate>
			<category>워드프레스</category>
		</item>
				<item>
			<title><![CDATA[안녕하세요~^^

남겨주신 내용으로는 어떤 목적인지 정확히 파악이 어렵습니다.

 

혹시 추천인 링크를...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/63252</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>남겨주신 내용으로는 어떤 목적인지 정확히 파악이 어렵습니다.</p>

<p> </p>

<p>혹시 추천인 링크를 타고 들어오면 해당 추천인에게 포인트가 지급되는</p>

<p>어필리에이트 시스템을 원하시는 걸까요?</p>

<p> </p>

<p>남겨주신 이미지는 어떤 플러그인의 어떤 메뉴인지 확인이 어렵습니다.</p>

<p>어떤 플러그인인지도 함께 남겨주시겠어요?</p>

<p> </p>

<p>플러그인이 동작되지 않는다면 디버그 모드를 활성화해서</p>

<p>어떤 오류 메시지가 표시되는지 확인해보셔야 할 듯합니다.</p>

<p>디버그 모드 활성화 방법은 아래의 링크를 참고해보세요.</p>

<p><a href="https://blog.naver.com/PostView.nhn?blogId=chan2rrj&amp;logNo=221223664194" target="_blank">워드프레스 에러 확인하기 - 디버그 모드 활성화 방법</a></p>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Wed, 15 Feb 2023 07:56:02 +0000</pubDate>
			<category>워드프레스</category>
		</item>
			</channel>
</rss>