<?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 for Gary Cao</title>
	<atom:link href="http://www.garyc40.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garyc40.com</link>
	<description>Freelance Web Developer</description>
	<lastBuildDate>Thu, 07 Apr 2011 10:09:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on 5 tips for using AJAX in WordPress by Robert</title>
		<link>http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/#comment-511</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Thu, 07 Apr 2011 10:09:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/?p=39#comment-511</guid>
		<description>Very goooood tutorial!!! :) It&#039;s very helpfull</description>
		<content:encoded><![CDATA[<p>Very goooood tutorial!!! <img src='http://www.garyc40.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It&#8217;s very helpfull</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ultimate Guide to Roles and Capabilities by Roy</title>
		<link>http://www.garyc40.com/2010/04/ultimate-guide-to-roles-and-capabilities/#comment-508</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Wed, 30 Mar 2011 18:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/?p=92#comment-508</guid>
		<description>Ok but did you try adding a new test user, then setting that user to the &#039;testrole&#039; and then login as the test user and then do a current_user_can var dump?</description>
		<content:encoded><![CDATA[<p>Ok but did you try adding a new test user, then setting that user to the &#8216;testrole&#8217; and then login as the test user and then do a current_user_can var dump?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ultimate Guide to Roles and Capabilities by Gary Cao</title>
		<link>http://www.garyc40.com/2010/04/ultimate-guide-to-roles-and-capabilities/#comment-507</link>
		<dc:creator>Gary Cao</dc:creator>
		<pubDate>Wed, 30 Mar 2011 09:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/?p=92#comment-507</guid>
		<description>This is strange. For me both of these &lt;code&gt;current_user_can()&lt;/code&gt; check out.

[php]
function test_caps() {
	add_role( &#039;testrole&#039;, array( &#039;read&#039; =&gt; true, &#039;panels&#039; =&gt; true ) );
	var_dump(current_user_can(&#039;panels&#039;)); // outputs true
	var_dump(current_user_can(&#039;member&#039;)); // outputs true
}
add_action(&#039;init&#039;, &#039;test_caps&#039;);
[/php]

Note that I&#039;m testing using an admin account.</description>
		<content:encoded><![CDATA[<p>This is strange. For me both of these <code>current_user_can()</code> check out.</p>
<pre class="brush: php; title: ;">
function test_caps() {
	add_role( 'testrole', array( 'read' =&gt; true, 'panels' =&gt; true ) );
	var_dump(current_user_can('panels')); // outputs true
	var_dump(current_user_can('member')); // outputs true
}
add_action('init', 'test_caps');
</pre>
<p>Note that I&#8217;m testing using an admin account.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on GSoC 2011 idea: Revamp WordPress theme / plugin code editor by Gary Cao</title>
		<link>http://www.garyc40.com/2011/03/gsoc-2011-idea-revamp-wordpress-theme-plugin-code-editor/#comment-506</link>
		<dc:creator>Gary Cao</dc:creator>
		<pubDate>Wed, 30 Mar 2011 09:00:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.garyc40.com/?p=150#comment-506</guid>
		<description>If this is a compliment, thanks!</description>
		<content:encoded><![CDATA[<p>If this is a compliment, thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on GSoC 2011 idea: Revamp WordPress theme / plugin code editor by Gary Cao</title>
		<link>http://www.garyc40.com/2011/03/gsoc-2011-idea-revamp-wordpress-theme-plugin-code-editor/#comment-505</link>
		<dc:creator>Gary Cao</dc:creator>
		<pubDate>Wed, 30 Mar 2011 09:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.garyc40.com/?p=150#comment-505</guid>
		<description>Thanks scribu :)</description>
		<content:encoded><![CDATA[<p>Thanks scribu <img src='http://www.garyc40.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on GSoC 2011 idea: Revamp WordPress theme / plugin code editor by theredcat</title>
		<link>http://www.garyc40.com/2011/03/gsoc-2011-idea-revamp-wordpress-theme-plugin-code-editor/#comment-504</link>
		<dc:creator>theredcat</dc:creator>
		<pubDate>Mon, 28 Mar 2011 11:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.garyc40.com/?p=150#comment-504</guid>
		<description>You are a very bad Wordpress developer, the worst... I&#039;m sick of you... I mean, hell, the WP team MUST hire you NOW. You&#039;d be the greatest fuc**ng addition for them!

- an amazed reader of your blog -</description>
		<content:encoded><![CDATA[<p>You are a very bad WordPress developer, the worst&#8230; I&#8217;m sick of you&#8230; I mean, hell, the WP team MUST hire you NOW. You&#8217;d be the greatest fuc**ng addition for them!</p>
<p>- an amazed reader of your blog -</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ultimate Guide to Roles and Capabilities by Roy</title>
		<link>http://www.garyc40.com/2010/04/ultimate-guide-to-roles-and-capabilities/#comment-502</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Mon, 28 Mar 2011 04:35:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/?p=92#comment-502</guid>
		<description>Hi Gary! Nice post and well explained.  I have came across a problem and wanted to see if you have encountered the same thing.  If I add custom role with capabilities, the function current_user_can() does not work.  However if I switch it to check for the role instead, it works.  According to the codex, current_user_can function() will accept both the role or the capabilities.  So I am not sure what went wrong there.  Below is the code in question.

add_role(&#039;member&#039;,&#039;Member&#039;,array(&#039;read&#039; =&gt; true, &#039;panels&#039; =&gt; true));

current_user_can(&#039;panels&#039;); &lt;----- doesn&#039;t work...
current_user_can(&#039;member&#039;); &lt;-----works.....</description>
		<content:encoded><![CDATA[<p>Hi Gary! Nice post and well explained.  I have came across a problem and wanted to see if you have encountered the same thing.  If I add custom role with capabilities, the function current_user_can() does not work.  However if I switch it to check for the role instead, it works.  According to the codex, current_user_can function() will accept both the role or the capabilities.  So I am not sure what went wrong there.  Below is the code in question.</p>
<p>add_role(&#8216;member&#8217;,'Member&#8217;,array(&#8216;read&#8217; =&gt; true, &#8216;panels&#8217; =&gt; true));</p>
<p>current_user_can(&#8216;panels&#8217;); &lt;&#8212;&#8211; doesn&#039;t work&#8230;<br />
current_user_can(&#039;member&#039;); &lt;&#8212;&#8211;works&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on GSoC 2011 idea: Revamp WordPress theme / plugin code editor by scribu</title>
		<link>http://www.garyc40.com/2011/03/gsoc-2011-idea-revamp-wordpress-theme-plugin-code-editor/#comment-501</link>
		<dc:creator>scribu</dc:creator>
		<pubDate>Mon, 28 Mar 2011 02:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.garyc40.com/?p=150#comment-501</guid>
		<description>Fortunately, I haven&#039;t had the &quot;pleasure&quot; of working with the WP code editor in quite a while.

But, with code highlighting and tabs, it could be almost as good as my desktop editor (gedit).

Good luck with your proposal!</description>
		<content:encoded><![CDATA[<p>Fortunately, I haven&#8217;t had the &#8220;pleasure&#8221; of working with the WP code editor in quite a while.</p>
<p>But, with code highlighting and tabs, it could be almost as good as my desktop editor (gedit).</p>
<p>Good luck with your proposal!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on 5 tips for using AJAX in WordPress by Gary Cao</title>
		<link>http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/#comment-491</link>
		<dc:creator>Gary Cao</dc:creator>
		<pubDate>Sat, 26 Mar 2011 10:08:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/?p=39#comment-491</guid>
		<description>You should use add_action() instead of do_action():

[php]
add_action( &#039;wp_ajax_submit-logout&#039;, &#039;my_plugin_submit_logout&#039; );
add_action( &#039;wp_ajax_star-rating&#039;, &#039;my_plugin_star_rating&#039; );
[/php]

&#039;my_plugin_submit_logout&#039; and &#039;my_plugin_star_rating&#039; are 2 functions that handle your request. &#039;submit-logout&#039; and &#039;star-rating&#039; are the action parameters of the request.

If you&#039;re still stuck, please send me an email with your code (garyc40 [at] garyc40.com), I&#039;ll try to help out as soon as I have some time :)</description>
		<content:encoded><![CDATA[<p>You should use add_action() instead of do_action():</p>
<pre class="brush: php; title: ;">
add_action( 'wp_ajax_submit-logout', 'my_plugin_submit_logout' );
add_action( 'wp_ajax_star-rating', 'my_plugin_star_rating' );
</pre>
<p>&#8216;my_plugin_submit_logout&#8217; and &#8216;my_plugin_star_rating&#8217; are 2 functions that handle your request. &#8216;submit-logout&#8217; and &#8216;star-rating&#8217; are the action parameters of the request.</p>
<p>If you&#8217;re still stuck, please send me an email with your code (garyc40 [at] garyc40.com), I&#8217;ll try to help out as soon as I have some time <img src='http://www.garyc40.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Make Shortcodes User-Friendly by Wordpress Affiliate Plugin</title>
		<link>http://www.garyc40.com/2010/03/how-to-make-shortcodes-user-friendly/#comment-490</link>
		<dc:creator>Wordpress Affiliate Plugin</dc:creator>
		<pubDate>Sat, 26 Mar 2011 07:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.wphardcore.com/wordpress/?p=12#comment-490</guid>
		<description>Very nice tutorial. 

I&#039;ve been programming for well over 15 years, have hundreds of websites and even have my own Wordpress plugin, but one specific part about adding a tinymce button to my plugin had me stumped. I really appreciate the code for the inline form call. It&#039;s not 100% what I was looking for, but it certainly solves my problem and gives me something to work from. 

Thanks again.</description>
		<content:encoded><![CDATA[<p>Very nice tutorial. </p>
<p>I&#8217;ve been programming for well over 15 years, have hundreds of websites and even have my own WordPress plugin, but one specific part about adding a tinymce button to my plugin had me stumped. I really appreciate the code for the inline form call. It&#8217;s not 100% what I was looking for, but it certainly solves my problem and gives me something to work from. </p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

