<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Using WP Approve User Plugin with WooCommerce	</title>
	<atom:link href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce/feed" rel="self" type="application/rss+xml" />
	<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce</link>
	<description>Web services made easy</description>
	<lastBuildDate>Sat, 21 Mar 2020 18:07:09 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-7208</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Fri, 27 Feb 2015 19:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-7208</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6788&quot;&gt;Gabriel&lt;/a&gt;.

Hey Gabriel,

I definitely haven&#039;t covered any of the registration portion of the check out process with this. I think I would try to keep the two separate if I could (ie: two levels of customers; normal customers that don&#039;t need to be approved and wholesale customers or something like that). I say this because a customer that just completed a payment probably shouldn&#039;t be blocked from logging in, even if they&#039;re limited to certain pricing or certain areas of the site because of this.

Isn&#039;t there an option in the user approve plugin to disable outgoing emails for registration? I thought that was added in a more recent version of the plugin.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6788">Gabriel</a>.</p>
<p>Hey Gabriel,</p>
<p>I definitely haven&#8217;t covered any of the registration portion of the check out process with this. I think I would try to keep the two separate if I could (ie: two levels of customers; normal customers that don&#8217;t need to be approved and wholesale customers or something like that). I say this because a customer that just completed a payment probably shouldn&#8217;t be blocked from logging in, even if they&#8217;re limited to certain pricing or certain areas of the site because of this.</p>
<p>Isn&#8217;t there an option in the user approve plugin to disable outgoing emails for registration? I thought that was added in a more recent version of the plugin.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gabriel		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6788</link>

		<dc:creator><![CDATA[Gabriel]]></dc:creator>
		<pubDate>Mon, 22 Sep 2014 10:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6788</guid>

					<description><![CDATA[Hi Jordan,

Amazing solution you have right here!
Thank you very much for the code and keeping this thread active!
I have added the code and most of it works just fine besides the below:

• We have 2 Approval emails being sent. Both the new woocommerce email as well as the User Approve plug-in default.
• We are still testing the check out etc.. but it seems a bit glitchy on the &quot;Registration on Check out form&quot;, shoukd it work the same or this solution just doesn&#039;t cover the check out registration?!

Once again thank you very much... I spent literally for ever trying to sort this out!]]></description>
			<content:encoded><![CDATA[<p>Hi Jordan,</p>
<p>Amazing solution you have right here!<br />
Thank you very much for the code and keeping this thread active!<br />
I have added the code and most of it works just fine besides the below:</p>
<p>• We have 2 Approval emails being sent. Both the new woocommerce email as well as the User Approve plug-in default.<br />
• We are still testing the check out etc.. but it seems a bit glitchy on the &#8220;Registration on Check out form&#8221;, shoukd it work the same or this solution just doesn&#8217;t cover the check out registration?!</p>
<p>Once again thank you very much&#8230; I spent literally for ever trying to sort this out!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6778</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Mon, 25 Aug 2014 15:45:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6778</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6776&quot;&gt;Katrina Morris&lt;/a&gt;.

No problem Katrina! Happy to help :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6776">Katrina Morris</a>.</p>
<p>No problem Katrina! Happy to help 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Katrina Morris		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6776</link>

		<dc:creator><![CDATA[Katrina Morris]]></dc:creator>
		<pubDate>Mon, 25 Aug 2014 00:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6776</guid>

					<description><![CDATA[Thank you so much for this. I spent about 5 hours looking into possible solutions. You&#039;re a life-saver!]]></description>
			<content:encoded><![CDATA[<p>Thank you so much for this. I spent about 5 hours looking into possible solutions. You&#8217;re a life-saver!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nerve		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6769</link>

		<dc:creator><![CDATA[Nerve]]></dc:creator>
		<pubDate>Thu, 31 Jul 2014 04:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6769</guid>

					<description><![CDATA[Hi, I have followed your instructions. Everything seems to be working fine, EXCEPT... after someone has registered, 
the &quot;Registration successful! You will be notified upon approval of your account.&quot; Does not show. 

It shows the approved=false in the URL and refreshes the page but the text line doesnt change.

Can you please assist.

Thanks


(From the section: if ($approved == &#039;false&#039;)  echo &#039;Registration successful! You will be notified upon approval of your account.&#039;;
                else echo $not_approved_message;
        }
        else echo $not_approved_message;
}]]></description>
			<content:encoded><![CDATA[<p>Hi, I have followed your instructions. Everything seems to be working fine, EXCEPT&#8230; after someone has registered,<br />
the &#8220;Registration successful! You will be notified upon approval of your account.&#8221; Does not show. </p>
<p>It shows the approved=false in the URL and refreshes the page but the text line doesnt change.</p>
<p>Can you please assist.</p>
<p>Thanks</p>
<p>(From the section: if ($approved == &#8216;false&#8217;)  echo &#8216;Registration successful! You will be notified upon approval of your account.&#8217;;<br />
                else echo $not_approved_message;<br />
        }<br />
        else echo $not_approved_message;<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Tozil		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6755</link>

		<dc:creator><![CDATA[Tozil]]></dc:creator>
		<pubDate>Fri, 18 Jul 2014 18:02:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6755</guid>

					<description><![CDATA[Love this! Helped me alot!! Thank you.]]></description>
			<content:encoded><![CDATA[<p>Love this! Helped me alot!! Thank you.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jose		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6754</link>

		<dc:creator><![CDATA[Jose]]></dc:creator>
		<pubDate>Thu, 17 Jul 2014 10:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6754</guid>

					<description><![CDATA[Thank you, you are the man!!]]></description>
			<content:encoded><![CDATA[<p>Thank you, you are the man!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6736</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Sat, 05 Jul 2014 18:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6736</guid>

					<description><![CDATA[Did you implement the second half of the guide regarding email notifications or did you use the wp approve user built in email notification system? It&#039;s possible that my code for that part could mess with things, especially with the latest release of WooCommerce as that code is quite a bit older now.]]></description>
			<content:encoded><![CDATA[<p>Did you implement the second half of the guide regarding email notifications or did you use the wp approve user built in email notification system? It&#8217;s possible that my code for that part could mess with things, especially with the latest release of WooCommerce as that code is quite a bit older now.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Helen		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6735</link>

		<dc:creator><![CDATA[Helen]]></dc:creator>
		<pubDate>Thu, 03 Jul 2014 09:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6735</guid>

					<description><![CDATA[Hey Jordan,

Thank you for this, it works like a dream. My only problem is that the admin does not receive notification of new users for approval. Is this easily done?
Thanks
H]]></description>
			<content:encoded><![CDATA[<p>Hey Jordan,</p>
<p>Thank you for this, it works like a dream. My only problem is that the admin does not receive notification of new users for approval. Is this easily done?<br />
Thanks<br />
H</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6715</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Thu, 05 Jun 2014 13:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6715</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6694&quot;&gt;Philip&lt;/a&gt;.

No problem! Happy to help :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6694">Philip</a>.</p>
<p>No problem! Happy to help 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jonathan		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6698</link>

		<dc:creator><![CDATA[Jonathan]]></dc:creator>
		<pubDate>Thu, 24 Apr 2014 16:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6698</guid>

					<description><![CDATA[Hi Jordan,

Thanks for the code. I&#039;ve got it working but now my admin email isn&#039;t receiving new user registrations anymore.
Could there be an issue with this? 

Cheers
J.]]></description>
			<content:encoded><![CDATA[<p>Hi Jordan,</p>
<p>Thanks for the code. I&#8217;ve got it working but now my admin email isn&#8217;t receiving new user registrations anymore.<br />
Could there be an issue with this? </p>
<p>Cheers<br />
J.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Philip		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6694</link>

		<dc:creator><![CDATA[Philip]]></dc:creator>
		<pubDate>Fri, 11 Apr 2014 09:55:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6694</guid>

					<description><![CDATA[Thank you for updating the code. It is really appreciated that you keep the code up to date...

THANKS!!]]></description>
			<content:encoded><![CDATA[<p>Thank you for updating the code. It is really appreciated that you keep the code up to date&#8230;</p>
<p>THANKS!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: allan portilho		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6693</link>

		<dc:creator><![CDATA[allan portilho]]></dc:creator>
		<pubDate>Wed, 19 Mar 2014 20:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6693</guid>

					<description><![CDATA[very thanks man]]></description>
			<content:encoded><![CDATA[<p>very thanks man</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6685</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Thu, 06 Feb 2014 19:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6685</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-570&quot;&gt;Anthony&lt;/a&gt;.

Anthony, the updated code above should fix this by using a hook that runs before header info is output to the browser. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-570">Anthony</a>.</p>
<p>Anthony, the updated code above should fix this by using a hook that runs before header info is output to the browser. Enjoy!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6681</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Wed, 29 Jan 2014 19:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6681</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6680&quot;&gt;Wouter Bredenbeek&lt;/a&gt;.

Thanks! I&#039;ve updated this in the code above as well.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6680">Wouter Bredenbeek</a>.</p>
<p>Thanks! I&#8217;ve updated this in the code above as well.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wouter Bredenbeek		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6680</link>

		<dc:creator><![CDATA[Wouter Bredenbeek]]></dc:creator>
		<pubDate>Wed, 29 Jan 2014 13:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6680</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6675&quot;&gt;ANerdsWorld&lt;/a&gt;.

Hey ANerdsWorld, change $current_user = get_current_user(); to $current_user = wp_get_current_user();. It worked for me.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6675">ANerdsWorld</a>.</p>
<p>Hey ANerdsWorld, change $current_user = get_current_user(); to $current_user = wp_get_current_user();. It worked for me.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ANerdsWorld		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6676</link>

		<dc:creator><![CDATA[ANerdsWorld]]></dc:creator>
		<pubDate>Thu, 09 Jan 2014 20:07:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6676</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6662&quot;&gt;Elle&lt;/a&gt;.

This solution works for the initial login but once I navigate away from the account page, I&#039;m logged out again. Any ideas?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6662">Elle</a>.</p>
<p>This solution works for the initial login but once I navigate away from the account page, I&#8217;m logged out again. Any ideas?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: ANerdsWorld		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6675</link>

		<dc:creator><![CDATA[ANerdsWorld]]></dc:creator>
		<pubDate>Thu, 09 Jan 2014 16:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6675</guid>

					<description><![CDATA[The solution for auto-logout was working well but doesn&#039;t seem to be working the latest version of WordPress. Anyone else experiencing this issue? Any idea for a fix?]]></description>
			<content:encoded><![CDATA[<p>The solution for auto-logout was working well but doesn&#8217;t seem to be working the latest version of WordPress. Anyone else experiencing this issue? Any idea for a fix?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ryan		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6671</link>

		<dc:creator><![CDATA[Ryan]]></dc:creator>
		<pubDate>Mon, 23 Dec 2013 16:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6671</guid>

					<description><![CDATA[I have tried all of the solutions mentioned in this great article, but still seem to get a 

Fatal error: Call to undefined function login_header() in /home/strutla/public_html/wp-content/plugins/new-user-approve/new-user-approve.php on line 538

after a user registers. 


any thoughts?]]></description>
			<content:encoded><![CDATA[<p>I have tried all of the solutions mentioned in this great article, but still seem to get a </p>
<p>Fatal error: Call to undefined function login_header() in /home/strutla/public_html/wp-content/plugins/new-user-approve/new-user-approve.php on line 538</p>
<p>after a user registers. </p>
<p>any thoughts?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6664</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Wed, 04 Dec 2013 02:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6664</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6662&quot;&gt;Elle&lt;/a&gt;.

Thanks for the tip Elle! It certainly sounds like it should do the trick :)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6662">Elle</a>.</p>
<p>Thanks for the tip Elle! It certainly sounds like it should do the trick 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Elle		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-6662</link>

		<dc:creator><![CDATA[Elle]]></dc:creator>
		<pubDate>Tue, 03 Dec 2013 11:53:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-6662</guid>

					<description><![CDATA[I had the headers error messages as well, so here&#039;s what I did - found where WooC calls the woocommerce_process_registration function - which was add_action(&#039;init&#039;, woocommerce_process_registration&#039;)

I then added the following:

remove_action(&#039;init&#039;, &#039;woocommerce_process_registration&#039;);
add_action(&#039;init&#039;, &#039;wp_approve_registration&#039;); 

I created the function wp_approve_registration() and copied the code from the woocommerce_process_registration() function found in the file woocommerce-functions.php

I removed the following code from my new function:

            // set the WP login cookie
            $secure_cookie = is_ssl() ? true : false;
            wp_set_auth_cookie($user_id, true, $secure_cookie);

And replaced it with the message code from Klang:

        $woocommerce-&#062;add_message( ‘Registration successful! You will be notified upon approval of your account.’, ‘woocommerce’ ) ;

And voila! I think it&#039;s working...]]></description>
			<content:encoded><![CDATA[<p>I had the headers error messages as well, so here&#8217;s what I did &#8211; found where WooC calls the woocommerce_process_registration function &#8211; which was add_action(&#8216;init&#8217;, woocommerce_process_registration&#8217;)</p>
<p>I then added the following:</p>
<p>remove_action(&#8216;init&#8217;, &#8216;woocommerce_process_registration&#8217;);<br />
add_action(&#8216;init&#8217;, &#8216;wp_approve_registration&#8217;); </p>
<p>I created the function wp_approve_registration() and copied the code from the woocommerce_process_registration() function found in the file woocommerce-functions.php</p>
<p>I removed the following code from my new function:</p>
<p>            // set the WP login cookie<br />
            $secure_cookie = is_ssl() ? true : false;<br />
            wp_set_auth_cookie($user_id, true, $secure_cookie);</p>
<p>And replaced it with the message code from Klang:</p>
<p>        $woocommerce-&gt;add_message( ‘Registration successful! You will be notified upon approval of your account.’, ‘woocommerce’ ) ;</p>
<p>And voila! I think it&#8217;s working&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Byron		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-5206</link>

		<dc:creator><![CDATA[Byron]]></dc:creator>
		<pubDate>Thu, 26 Sep 2013 17:05:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-5206</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-3846&quot;&gt;logothetis&lt;/a&gt;.

This is the code that I used:

/if the user hasn&#039;t been approved yet by WP Approve User plugin, log them out immediately
if ( empty($approved_status) &#124;&#124; $approved_status == 0  ){
				
	//get the nonce value
	$nonceUrl = wp_logout_url(get_bloginfo(&#039;url&#039;)); 
	$noncePos = strpos($nonceUrl, &#039;_wpnonce=&#039;) + strlen(&#039;_wpnonce=&#039;);
	$nonceVal = substr($nonceUrl, $noncePos);
	
	//set request headers
	$_REQUEST[&#039;action&#039;] = &#039;logout&#039;;
	$_REQUEST[&#039;redirect_to&#039;] = home_url();
	$_REQUEST[&#039;_wpnonce&#039;] = $nonceVal;
	
	//code from wp-login
	check_admin_referer(&#039;log-out&#039;);
	
	wp_logout();
	$redirect_to = !empty( $_REQUEST[&#039;redirect_to&#039;] ) ? $_REQUEST[&#039;redirect_to&#039;] : &#039;wp-login.php?loggedout=true&#039;;
	wp_safe_redirect( $redirect_to );
	exit();
}]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-3846">logothetis</a>.</p>
<p>This is the code that I used:</p>
<p>/if the user hasn&#8217;t been approved yet by WP Approve User plugin, log them out immediately<br />
if ( empty($approved_status) || $approved_status == 0  ){</p>
<p>	//get the nonce value<br />
	$nonceUrl = wp_logout_url(get_bloginfo(&#8216;url&#8217;));<br />
	$noncePos = strpos($nonceUrl, &#8216;_wpnonce=&#8217;) + strlen(&#8216;_wpnonce=&#8217;);<br />
	$nonceVal = substr($nonceUrl, $noncePos);</p>
<p>	//set request headers<br />
	$_REQUEST[&#8216;action&#8217;] = &#8216;logout&#8217;;<br />
	$_REQUEST[&#8216;redirect_to&#8217;] = home_url();<br />
	$_REQUEST[&#8216;_wpnonce&#8217;] = $nonceVal;</p>
<p>	//code from wp-login<br />
	check_admin_referer(&#8216;log-out&#8217;);</p>
<p>	wp_logout();<br />
	$redirect_to = !empty( $_REQUEST[&#8216;redirect_to&#8217;] ) ? $_REQUEST[&#8216;redirect_to&#8217;] : &#8216;wp-login.php?loggedout=true&#8217;;<br />
	wp_safe_redirect( $redirect_to );<br />
	exit();<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jordan Schelew		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-5178</link>

		<dc:creator><![CDATA[Jordan Schelew]]></dc:creator>
		<pubDate>Thu, 26 Sep 2013 13:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-5178</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-5120&quot;&gt;Klang&lt;/a&gt;.

Thanks Klang! I really appreciate the input as I haven&#039;t had a lot of time to play with this and get the guide updated :)

Doesn&#039;t removing the wp_set_auth_cookie then cause issues later when people are approved and trying to log in via the WooCommerce login page?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-5120">Klang</a>.</p>
<p>Thanks Klang! I really appreciate the input as I haven&#8217;t had a lot of time to play with this and get the guide updated 🙂</p>
<p>Doesn&#8217;t removing the wp_set_auth_cookie then cause issues later when people are approved and trying to log in via the WooCommerce login page?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Klang		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-5120</link>

		<dc:creator><![CDATA[Klang]]></dc:creator>
		<pubDate>Thu, 26 Sep 2013 07:23:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-5120</guid>

					<description><![CDATA[Thanks for the idea. This help me a lot.

For the problem with a lot of &quot;Cannot modify header information&quot; errors, I&#039;ve figured it out.

The hook &quot;woocommerce_before_my_account&quot; is inside the my account page which already been output some code to the browser, so that the function wp_logout() will NOT work.

My quick dirty solution is to change some code in woocommerce-functions.php. (you should do this as a hook instead, but I don&#039;t have time)

In the function woocommerce_process_registration(), comment out this line:
wp_set_auth_cookie($user_id, true, $secure_cookie);

Boom! No more auto-login.

For the custom message, add this line after the one we just comment out:
$woocommerce-&#062;add_message( &#039;Registration successful! You will be notified upon approval of your account.&#039;, &#039;woocommerce&#039; ) ;

Hope this help!]]></description>
			<content:encoded><![CDATA[<p>Thanks for the idea. This help me a lot.</p>
<p>For the problem with a lot of &#8220;Cannot modify header information&#8221; errors, I&#8217;ve figured it out.</p>
<p>The hook &#8220;woocommerce_before_my_account&#8221; is inside the my account page which already been output some code to the browser, so that the function wp_logout() will NOT work.</p>
<p>My quick dirty solution is to change some code in woocommerce-functions.php. (you should do this as a hook instead, but I don&#8217;t have time)</p>
<p>In the function woocommerce_process_registration(), comment out this line:<br />
wp_set_auth_cookie($user_id, true, $secure_cookie);</p>
<p>Boom! No more auto-login.</p>
<p>For the custom message, add this line after the one we just comment out:<br />
$woocommerce-&gt;add_message( &#8216;Registration successful! You will be notified upon approval of your account.&#8217;, &#8216;woocommerce&#8217; ) ;</p>
<p>Hope this help!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: logothetis		</title>
		<link>https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-3846</link>

		<dc:creator><![CDATA[logothetis]]></dc:creator>
		<pubDate>Mon, 16 Sep 2013 11:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.grapekiwi.ca/?p=590#comment-3846</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-2327&quot;&gt;Jordan Schelew&lt;/a&gt;.

Any update on this?

Thanks!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://websavers.ca/using-wp-approve-user-plugin-with-woocommerce#comment-2327">Jordan Schelew</a>.</p>
<p>Any update on this?</p>
<p>Thanks!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: websavers.ca @ 2026-06-22 02:09:25 by W3 Total Cache
-->