<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>Peter&#039;s Useful Crap - Topic: redirect based on roles</title>
	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles</link>
	<description><![CDATA[Useful tips on Canada, cell phones, banking, technology, WordPress, PHP and more]]></description>
	<generator>Simple:Press Version 5.5.1</generator>
	<atom:link href="http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>mortenmr on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p3016</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p3016</guid>
        	        	<description><![CDATA[<p>I have the same problem, but looks like the code have been rewritten since this workaround was posted. I'm not too familiar with writing code, so I very thankful if you could have a look at it; </p>
<p>Lines 819-847:<br />
function wpmem_login()<br />
{<br />
	if( isset( $_POST['redirect_to'] ) ) {<br />
		$redirect_to = $_POST['redirect_to'];<br />
	} else {<br />
		$redirect_to = $_SERVER['PHP_SELF'];<br />
	}<br />
	$redirect_to = apply_filters( 'wpmem_login_redirect', $redirect_to );<br />
	if( isset( $_POST['rememberme'] ) == 'forever' ) {<br />
		$rememberme = true;<br />
	} else {<br />
		$rememberme = false;<br />
	}<br />
<img class="sfsmiley" src="http://www.theblog.ca/wp-content/forum-smileys/sf-surprised.gif" alt="Surprised" /></p>
]]></description>
        	        	<pubDate>Thu, 29 Mar 2012 12:29:22 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2968</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2968</guid>
        	        	<description><![CDATA[<p>It's likely most efficient for the wp-members creators to use the standard login_redirect hook.  Unfortunately I don't know the inner-workings of their plugin well enough to suggest a more sophisticated workaround.</p>
]]></description>
        	        	<pubDate>Thu, 16 Feb 2012 23:02:08 +0000</pubDate>
        </item>
        <item>
        	<title>Andrew Cartmill on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2966</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2966</guid>
        	        	<description><![CDATA[<p>I'm having the same issue with wp-members, but the prescribed solution of replacing likes 367-370 didn't work for me, and ends up breaking my redirect entirely (the page doesn't load, but it does show the correct url in the address bar)..</p>
<p>any idea why? </p>
<p>Andrew</p>
]]></description>
        	        	<pubDate>Thu, 16 Feb 2012 10:56:46 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2952</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2952</guid>
        	        	<description><![CDATA[<p>As a quick fix, you can replace the lines you referenced (367 to 370) with:</p>
<p>$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);</p>
<p>For future maintainability, though, since they are bypassing the standard login_redirect WordPress hook, I'd suggest having them implement a similar mechanism into future releases.</p>
]]></description>
        	        	<pubDate>Mon, 06 Feb 2012 07:29:03 +0000</pubDate>
        </item>
        <item>
        	<title>creo on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2951</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2951</guid>
        	        	<description><![CDATA[<p>Ok I contacted my theme support and they have run some tests and determined that is not the theme causing the issues,,, it is the plugin WP-Members. Below is the message I had received from them.<br />
I'm not sure if there is a way to disable the redirect and let your Plugin handle the redirect. </p>
<p>____________________</p>
<p>In the end it wasn't our theme causing the redirect issue with the "Peters Login Redirect" plugin, but instead it was the "WP Members" plugin causing the issue.</p>
<p>If you open up the following file on your server wp-members/wp-members-dialogs.php and go to line # 794 you'll see the input field:</p>
<p>';</p>
<p>This input field gets outputted on the login form on your homepage.</p>
<p>When I viewed source on your homepage I noticed that the input field value was blank:</p>
<p>Now if you open up the following file on your server plugins/wp-members/wp-members-core.php and go to line # 367 - 370 you'll see the following code:</p>
<p>$redirect_to = $_POST['redirect_to'];<br />
if (!$redirect_to) {<br />
	$redirect_to = $_SERVER['PHP_SELF'];<br />
}<br />
This code is saying if the $_POST['redirect_to'] field is empty set the $redirect_to variable to $_SERVER['PHP_SELF'] which means redirect to the page you're on.</p>
<p>The line of code that handles the redirect is on line # 386 in the same file:</p>
<p>wp_redirect($redirect_to);</p>
<p>This is why the "Peters Login Redirect" plugin isn't working.</p>
]]></description>
        	        	<pubDate>Mon, 06 Feb 2012 06:37:03 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2948</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2948</guid>
        	        	<description><![CDATA[<p>You could also do a test by modifying this line near the bottom of my plugin and setting the second parameter to 1 instead of 10:</p>
<p>add_filter( 'login_redirect', 'redirect_wrapper', 10, 3 );</p>
<p>However, if the theme also tries to take the highest priority, it might still win out.</p>
]]></description>
        	        	<pubDate>Thu, 02 Feb 2012 15:42:17 +0000</pubDate>
        </item>
        <item>
        	<title>Peter on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2947</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2947</guid>
        	        	<description><![CDATA[<p>Sorry to hear about your troubles. I have tested this on your site by logging in through the admin panel and the redirect was performed successfully.  It of course fails when logging in through the front-end.  I would suggest getting support from your theme provider as it looks like they are hooking into the login redirect action and "hijacking" the behavior.</p>
]]></description>
        	        	<pubDate>Thu, 02 Feb 2012 15:36:05 +0000</pubDate>
        </item>
        <item>
        	<title>creo on redirect based on roles</title>
        	<link>http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2946</link>
        	<category>Peter's Login Redirect</category>
        	<guid isPermaLink="true">http://www.theblog.ca/peter-forum/peters-login-redirect/redirect-based-on-roles#p2946</guid>
        	        	<description><![CDATA[<p>ok I'm ready to punch my monitor. I have been trying to tackle this all day but can't figure out what I'm doing wrong.</p>
<p>I have install the redirect plugin and want to redirect based on roles. I have set up two roles "employee" and "vendor" and want to redirect each to their appropriate page after logging in.</p>
<p>I'm using the WP-member plugin for users to register. Once registered I have assigned them a role.</p>
<p>When I log in as a registered user it keeps me on the login page and says I'm logged in... it doesn't redirect to the page I had specified in the setup. </p>
<p>If enter in a URL for the ALL USERS log out function.. that seems to work when I log out.</p>
<p>Any idea where I should be looking to correct the redirect based on roles?</p>
]]></description>
        	        	<pubDate>Thu, 02 Feb 2012 11:58:04 +0000</pubDate>
        </item>
</channel>
</rss>