<?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 AJAX In Your WordPress Theme Admin</title>
	<atom:link href="http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/</link>
	<description>Coding Tutorials, hints &#38; tips in PHP, jQuery, CSS &#38; HTML</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:16:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17429</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Tue, 29 Jun 2010 08:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17429</guid>
		<description>Bollocks... That&#039;s what you get for touch typing &amp; then not proof reading your code. :( I&#039;ve fixed it now.

Yeah, it&#039;s not like we can be suprised about the football though really. :(</description>
		<content:encoded><![CDATA[<p>Bollocks&#8230; That&#8217;s what you get for touch typing &#038; then not proof reading your code. <img src='http://return-true.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I&#8217;ve fixed it now.</p>
<p>Yeah, it&#8217;s not like we can be suprised about the football though really. <img src='http://return-true.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kathy</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17426</link>
		<dc:creator>kathy</dc:creator>
		<pubDate>Tue, 29 Jun 2010 01:59:06 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17426</guid>
		<description>hi again paul.  just dropping back in to point out an error in your new code.  

get_options  should be get_option otherwise you get a fatal call to an undefined function

here is a pastebin of all the pieces smushed together for anyone who needs it:

http://pastebin.com/vfxiPyMv

too bad about our footie teams.</description>
		<content:encoded><![CDATA[<p>hi again paul.  just dropping back in to point out an error in your new code.  </p>
<p>get_options  should be get_option otherwise you get a fatal call to an undefined function</p>
<p>here is a pastebin of all the pieces smushed together for anyone who needs it:</p>
<p><a href="http://pastebin.com/vfxiPyMv" rel="nofollow">http://pastebin.com/vfxiPyMv</a></p>
<p>too bad about our footie teams.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17389</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Sat, 26 Jun 2010 10:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17389</guid>
		<description>Okay the post has been updated to include the updated information. I&#039;ve also added the code on how to pull the options back into the form.</description>
		<content:encoded><![CDATA[<p>Okay the post has been updated to include the updated information. I&#8217;ve also added the code on how to pull the options back into the form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17383</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Sat, 26 Jun 2010 01:38:26 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17383</guid>
		<description>Ooops. Haha. Yeah we don&#039;t normally get much sun even in the summer but it&#039;s been hitting 30 degrees. The problem Is we aren&#039;t used to it so it kills us. We are all used to the crappy weather. Hehe.

I didn&#039;t realise the was the only tutorial on how to ajaxify a WP them admin. I&#039;ll go through it tomorrow &amp; clean it up a bit.

Nah, not tonight. I&#039;m saving all my drinking points for the England Vs Germany match on Sunday. Not usually a football fan but I make an exception for the world cup. ;)

Don&#039;t worry about it, always glad to help. Nod it&#039;s 2:37 in the morning here so I&#039;m of to bed. ;)</description>
		<content:encoded><![CDATA[<p>Ooops. Haha. Yeah we don&#8217;t normally get much sun even in the summer but it&#8217;s been hitting 30 degrees. The problem Is we aren&#8217;t used to it so it kills us. We are all used to the crappy weather. Hehe.</p>
<p>I didn&#8217;t realise the was the only tutorial on how to ajaxify a WP them admin. I&#8217;ll go through it tomorrow &#038; clean it up a bit.</p>
<p>Nah, not tonight. I&#8217;m saving all my drinking points for the England Vs Germany match on Sunday. Not usually a football fan but I make an exception for the world cup. <img src='http://return-true.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Don&#8217;t worry about it, always glad to help. Nod it&#8217;s 2:37 in the morning here so I&#8217;m of to bed. <img src='http://return-true.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kathy</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17382</link>
		<dc:creator>kathy</dc:creator>
		<pubDate>Sat, 26 Jun 2010 01:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17382</guid>
		<description>nope... across the pond in &#039;the colonies&#039;, but we&#039;ve (at least my area) been getting killed by the sun too.  

yours is the only tutorial on ajaxifying theme options so it was a great find... and even better since you are up in the wee hours of the morning to help get it sorted when we both ought to be down the pub on a friday night.  

thanks for everything!</description>
		<content:encoded><![CDATA[<p>nope&#8230; across the pond in &#8216;the colonies&#8217;, but we&#8217;ve (at least my area) been getting killed by the sun too.  </p>
<p>yours is the only tutorial on ajaxifying theme options so it was a great find&#8230; and even better since you are up in the wee hours of the morning to help get it sorted when we both ought to be down the pub on a friday night.  </p>
<p>thanks for everything!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17381</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Sat, 26 Jun 2010 00:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17381</guid>
		<description>Ahhh yes. No worries. Also nice job on that addition to the code. I actually had that in &amp; forgot to copy it over as part of the replacement. Doh!

I apologize for all the problems I&#039;m assuming you&#039;re in the UK (from your sun comment before), I think the heat has just killed my brain. :(

I&#039;ll update the post tomorrow (well today, lol) and I&#039;ll add in how to return the values back. Which I should have done in the first place.</description>
		<content:encoded><![CDATA[<p>Ahhh yes. No worries. Also nice job on that addition to the code. I actually had that in &#038; forgot to copy it over as part of the replacement. Doh!</p>
<p>I apologize for all the problems I&#8217;m assuming you&#8217;re in the UK (from your sun comment before), I think the heat has just killed my brain. <img src='http://return-true.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I&#8217;ll update the post tomorrow (well today, lol) and I&#8217;ll add in how to return the values back. Which I should have done in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kathy</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17380</link>
		<dc:creator>kathy</dc:creator>
		<pubDate>Sat, 26 Jun 2010 00:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17380</guid>
		<description>i am sure that you know how to do this, but if you are going to update the post it might be nice to show up to get the data back out of the array for use in the theme, etc.  for instance this would be how to show the current values in the form:  

[php]
&lt;?php $options = get_option(&#039;test_theme&#039;);?&gt;
&lt;input type=&quot;text&quot; name=&quot;test_text&quot; value=&quot;&lt;?php echo $options[test_text];?&gt;&quot;/&gt;&lt;br /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;test_check&quot; &quot; &lt;?php if($options[test_check]==&#039;on&#039;){echo &#039;checked&#039;;} ?&gt;/&gt;&lt;br /&gt;
[/php]</description>
		<content:encoded><![CDATA[<p>i am sure that you know how to do this, but if you are going to update the post it might be nice to show up to get the data back out of the array for use in the theme, etc.  for instance this would be how to show the current values in the form:  </p>
<pre class="brush: php;">
&lt;?php $options = get_option('test_theme');?&gt;
&lt;input type=&quot;text&quot; name=&quot;test_text&quot; value=&quot;&lt;?php echo $options[test_text];?&gt;&quot;/&gt;&lt;br /&gt;
&lt;input type=&quot;checkbox&quot; name=&quot;test_check&quot; &quot; &lt;?php if($options[test_check]=='on'){echo 'checked';} ?&gt;/&gt;&lt;br /&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: kathy</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17379</link>
		<dc:creator>kathy</dc:creator>
		<pubDate>Sat, 26 Jun 2010 00:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17379</guid>
		<description>we might have it!?  i had to blend your last 2 suggestions together and now my whole function looks like:

http://pastebin.com/0WJsfsw7

this seems to work.  i get options showing in the database.  i can echo them back.  i can delete the whole field from my database and it re-creates on the next save.  

now... on to applying this to all my options!  thank you so much for all the help.</description>
		<content:encoded><![CDATA[<p>we might have it!?  i had to blend your last 2 suggestions together and now my whole function looks like:</p>
<p><a href="http://pastebin.com/0WJsfsw7" rel="nofollow">http://pastebin.com/0WJsfsw7</a></p>
<p>this seems to work.  i get options showing in the database.  i can echo them back.  i can delete the whole field from my database and it re-creates on the next save.  </p>
<p>now&#8230; on to applying this to all my options!  thank you so much for all the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17378</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Fri, 25 Jun 2010 22:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17378</guid>
		<description>Can you please try this bit of code. If it works I&#039;ll update the post. I fixed this a little while ago &amp; it looks like I didn&#039;t update the post. :( I apologize.
[php]
//Find this line
$diff = array_diff(get_option(&#039;test_theme&#039;), $data);
//Replace with this
if(!empty($data)) {
	$diff = array_diff(get_option(&#039;test_theme&#039;), $data);
	$diff2 = array_diff($data, get_option(&#039;test_theme&#039;));
	$diff = array_merge($diff, $diff2);
} else {
	$diff = array(&#039;dummy&#039; =&gt; &#039;dummy&#039;);
}
[/php]

The actual saving part would work it&#039;s just the bit that checks to see if the options are different isn&#039;t. Hopefully that will fix it. I have tested it &amp; it seems to work.

Let me know how it goes.</description>
		<content:encoded><![CDATA[<p>Can you please try this bit of code. If it works I&#8217;ll update the post. I fixed this a little while ago &#038; it looks like I didn&#8217;t update the post. <img src='http://return-true.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  I apologize.</p>
<pre class="brush: php;">
//Find this line
$diff = array_diff(get_option('test_theme'), $data);
//Replace with this
if(!empty($data)) {
	$diff = array_diff(get_option('test_theme'), $data);
	$diff2 = array_diff($data, get_option('test_theme'));
	$diff = array_merge($diff, $diff2);
} else {
	$diff = array('dummy' =&gt; 'dummy');
}
</pre>
<p>The actual saving part would work it&#8217;s just the bit that checks to see if the options are different isn&#8217;t. Hopefully that will fix it. I have tested it &#038; it seems to work.</p>
<p>Let me know how it goes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Robinson</title>
		<link>http://return-true.com/2010/01/using-ajax-in-your-wordpress-theme-admin/comment-page-2/#comment-17377</link>
		<dc:creator>Paul Robinson</dc:creator>
		<pubDate>Fri, 25 Jun 2010 22:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://return-true.com/?p=1440#comment-17377</guid>
		<description>Hmm! No I hadn&#039;t thought about that. I would say set the forms action to the php page that AJAX contacts. In that case the data will be sent as if it was being sent by AJAX.

I think I remember having a problem like you mentioned and I thought I&#039;d fixed it. :(

I&#039;ll have a look at the version I mentioned before and see if I can find how I got around it.</description>
		<content:encoded><![CDATA[<p>Hmm! No I hadn&#8217;t thought about that. I would say set the forms action to the php page that AJAX contacts. In that case the data will be sent as if it was being sent by AJAX.</p>
<p>I think I remember having a problem like you mentioned and I thought I&#8217;d fixed it. <img src='http://return-true.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I&#8217;ll have a look at the version I mentioned before and see if I can find how I got around it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
