<?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: Get WordPress users by role</title>
	<atom:link href="http://sltaylor.co.uk/blog/get-wordpress-users-by-role/feed/" rel="self" type="application/rss+xml" />
	<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/</link>
	<description>Freelance WordPress developer in London - XHTML, CSS &#38; design</description>
	<lastBuildDate>Wed, 19 Oct 2011 15:15:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-21876</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Sun, 19 Jun 2011 10:45:15 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-21876</guid>
		<description>Kexin, this code is out of date. Use &lt;code&gt;&lt;a href=&quot;http://codex.wordpress.org/Function_Reference/get_users&quot;&gt;get_users&lt;/a&gt;&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>Kexin, this code is out of date. Use <code><a href="http://codex.wordpress.org/Function_Reference/get_users">get_users</a></code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kexin Li</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-21845</link>
		<dc:creator>Kexin Li</dc:creator>
		<pubDate>Sat, 18 Jun 2011 11:37:30 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-21845</guid>
		<description>Hi Steve,

Thanks for sharing the plugin. Can you please tell me how I can call this function on my template? For example I want to list all administrators</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>Thanks for sharing the plugin. Can you please tell me how I can call this function on my template? For example I want to list all administrators</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-17836</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Thu, 14 Apr 2011 09:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-17836</guid>
		<description>Hi rayne, sounds like you need some custom SQL querying. Or, if you don&#039;t mind the extra database hits (or you have a caching plugin working and it doesn&#039;t matter), just grab the most recent post for each author in the loop as you output them, and test the date. HTH.</description>
		<content:encoded><![CDATA[<p>Hi rayne, sounds like you need some custom SQL querying. Or, if you don&#8217;t mind the extra database hits (or you have a caching plugin working and it doesn&#8217;t matter), just grab the most recent post for each author in the loop as you output them, and test the date. HTH.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rayne</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-17829</link>
		<dc:creator>rayne</dc:creator>
		<pubDate>Thu, 14 Apr 2011 08:34:20 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-17829</guid>
		<description>Thanks for this script! I found it while I was looking for a way to &quot;gray out&quot; inactive authors - I want a list of authors where every author who hasn&#039;t posted anything in the last 6 or 12 months is applied an extra CSS class (eg. gray font color or 50% opacity). Would that be easy to implement into your script? My PHP skills are too crappy to figure it out myself :/</description>
		<content:encoded><![CDATA[<p>Thanks for this script! I found it while I was looking for a way to &#8220;gray out&#8221; inactive authors &#8211; I want a list of authors where every author who hasn&#8217;t posted anything in the last 6 or 12 months is applied an extra CSS class (eg. gray font color or 50% opacity). Would that be easy to implement into your script? My PHP skills are too crappy to figure it out myself :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-17803</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Wed, 13 Apr 2011 22:51:43 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-17803</guid>
		<description>Indeed, thanks Brent! I&#039;ve just been updating my plugins to use this new function.</description>
		<content:encoded><![CDATA[<p>Indeed, thanks Brent! I&#8217;ve just been updating my plugins to use this new function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Shepherd</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-17787</link>
		<dc:creator>Brent Shepherd</dc:creator>
		<pubDate>Wed, 13 Apr 2011 18:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-17787</guid>
		<description>With WordPress 3.1 and newer, we can use the get_users function: http://codex.wordpress.org/Function_Reference/get_users</description>
		<content:encoded><![CDATA[<p>With WordPress 3.1 and newer, we can use the get_users function: <a href="http://codex.wordpress.org/Function_Reference/get_users">http://codex.wordpress.org/Function_Reference/get_users</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Franks</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-17159</link>
		<dc:creator>John Franks</dc:creator>
		<pubDate>Sun, 03 Apr 2011 11:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-17159</guid>
		<description>You don&#039;t know how much time you saved me.   I had a site up that used basically the same code that you wrote.  It would select all users in a role.

Anyways the site got infected with a virus and I decided to scratch it and start over.  Unfortunately I didn&#039;t have a backup and lost the code.

I was really dreading to have to rewrite it.  But thankfully, I found your site now I don&#039;t have to.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t know how much time you saved me.   I had a site up that used basically the same code that you wrote.  It would select all users in a role.</p>
<p>Anyways the site got infected with a virus and I decided to scratch it and start over.  Unfortunately I didn&#8217;t have a backup and lost the code.</p>
<p>I was really dreading to have to rewrite it.  But thankfully, I found your site now I don&#8217;t have to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mat_</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-12440</link>
		<dc:creator>Mat_</dc:creator>
		<pubDate>Sun, 09 Jan 2011 11:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-12440</guid>
		<description>Thanks for this code! I haven&#039;t tested it yet but i&#039;m sure it works.
It saves me a lot of time!
Many Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for this code! I haven&#8217;t tested it yet but i&#8217;m sure it works.<br />
It saves me a lot of time!<br />
Many Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-10506</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Thu, 18 Nov 2010 03:36:28 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-10506</guid>
		<description>Really cool Steve been trying to write code similar to this myself (but not trying too hard) luckily found you could while doing my research and now I can get to bed early! You&#039;re a prince!</description>
		<content:encoded><![CDATA[<p>Really cool Steve been trying to write code similar to this myself (but not trying too hard) luckily found you could while doing my research and now I can get to bed early! You&#8217;re a prince!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Taylor</title>
		<link>http://sltaylor.co.uk/blog/get-wordpress-users-by-role/#comment-10081</link>
		<dc:creator>Steve Taylor</dc:creator>
		<pubDate>Sun, 07 Nov 2010 14:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://sltaylor.co.uk/?p=261#comment-10081</guid>
		<description>I can confirm that the SQL in the first example works fine. The second variant seems pretty straightforward, but I don&#039;t have time for extensive testing, so let me know if it trips up anywhere.

As for &lt;code&gt;WP_User_Search&lt;/code&gt;, for me it only returns users in the specified role. Looking at &lt;a href=&quot;http://core.trac.wordpress.org/browser/tags/3.0.1/wp-admin/includes/user.php#L687&quot;&gt;the source&lt;/a&gt;, this does seem to be how it works. Let me know if you can confirm a situation where this isn&#039;t the case.

Interestingly, it seem that &lt;code&gt;WP_User_Search&lt;/code&gt; &lt;a href=&quot;http://wpdevel.wordpress.com/2010/10/07/wp_user_search-has-been-replaced-by-wp_u/&quot;&gt;has been deprecated&lt;/a&gt; for the next version of WP. I&#039;ve not looked into how its replacement works.</description>
		<content:encoded><![CDATA[<p>I can confirm that the SQL in the first example works fine. The second variant seems pretty straightforward, but I don&#8217;t have time for extensive testing, so let me know if it trips up anywhere.</p>
<p>As for <code>WP_User_Search</code>, for me it only returns users in the specified role. Looking at <a href="http://core.trac.wordpress.org/browser/tags/3.0.1/wp-admin/includes/user.php#L687">the source</a>, this does seem to be how it works. Let me know if you can confirm a situation where this isn&#8217;t the case.</p>
<p>Interestingly, it seem that <code>WP_User_Search</code> <a href="http://wpdevel.wordpress.com/2010/10/07/wp_user_search-has-been-replaced-by-wp_u/">has been deprecated</a> for the next version of WP. I&#8217;ve not looked into how its replacement works.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  sltaylor.co.uk/blog/get-wordpress-users-by-role/feed/ ) in 0.23957 seconds, on Feb 4th, 2012 at 2:56 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 4th, 2012 at 3:56 am UTC -->
