<?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: Disappearing Custom Post Data</title>
	<atom:link href="http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/</link>
	<description>Making a Difference Through Software</description>
	<lastBuildDate>Mon, 15 Aug 2011 18:18:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Michael</title>
		<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/#comment-128</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Fri, 06 Aug 2010 11:51:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikoder.com.au/?p=226#comment-128</guid>
		<description>The possible downside depends on where you&#039;re calling save_salary. If you&#039;re hooking the save_post event then you risk the problem I mentioned when a post is edited using the Quick Editor, or even when a comment is made on the post.  At the very least you should test that you actually have the salary field - &lt;code&gt;if (isset($_POST[&quot;salary&quot;])) ... &lt;/code&gt;.

Also, if you&#039;re expecting that &quot;salary&quot; is a pure number, you should typecast it so that any errors will be spotted when the post is saved, not when the value is being used, ie &lt;code&gt;(float) $_POST[&quot;salary&quot;]&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>The possible downside depends on where you&#8217;re calling save_salary. If you&#8217;re hooking the save_post event then you risk the problem I mentioned when a post is edited using the Quick Editor, or even when a comment is made on the post.  At the very least you should test that you actually have the salary field &#8211; <code>if (isset($_POST[&quot;salary&quot;])) ... </code>.</p>
<p>Also, if you&#8217;re expecting that &#8220;salary&#8221; is a pure number, you should typecast it so that any errors will be spotted when the post is saved, not when the value is being used, ie <code>(float) $_POST[&quot;salary&quot;]</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Hooghiem</title>
		<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/#comment-127</link>
		<dc:creator>Craig Hooghiem</dc:creator>
		<pubDate>Thu, 05 Aug 2010 17:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikoder.com.au/?p=226#comment-127</guid>
		<description>Is there a reason I might not be experiencing this?
I&#039;m using the latest version of WP and the only function I use for saving is:

	function save_salary(){
		global $post;
		update_post_meta($post-&gt;ID, &quot;salary&quot;, $_POST[&quot;salary&quot;]);
	}

Is there a downside to what I&#039;m doing?</description>
		<content:encoded><![CDATA[<p>Is there a reason I might not be experiencing this?<br />
I&#8217;m using the latest version of WP and the only function I use for saving is:</p>
<p>	function save_salary(){<br />
		global $post;<br />
		update_post_meta($post-&gt;ID, &#8220;salary&#8221;, $_POST["salary"]);<br />
	}</p>
<p>Is there a downside to what I&#8217;m doing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizuka</title>
		<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/#comment-74</link>
		<dc:creator>lizuka</dc:creator>
		<pubDate>Mon, 05 Jul 2010 09:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikoder.com.au/?p=226#comment-74</guid>
		<description>is there ? Plugin development is new to me, and I&#039;m eager to learn all the tricks to make decent code.
Also the API could be better documented sometimes.</description>
		<content:encoded><![CDATA[<p>is there ? Plugin development is new to me, and I&#8217;m eager to learn all the tricks to make decent code.<br />
Also the API could be better documented sometimes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/#comment-62</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Fri, 02 Jul 2010 09:26:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikoder.com.au/?p=226#comment-62</guid>
		<description>Yeah, that&#039;s really a throw-back to earlier versions of WP. I haven&#039;t seen any places in WP in recent versions where $post_id isn&#039;t set when the action is called.

I should also say there is a new &quot;standard&quot; way of testing for revisions and getting the original &quot;real&quot; post ID, however you still need to check that your plug-in fields are present in $_POST[] because they won&#039;t be when the quick editor is used instead of the full post editor screen.</description>
		<content:encoded><![CDATA[<p>Yeah, that&#8217;s really a throw-back to earlier versions of WP. I haven&#8217;t seen any places in WP in recent versions where $post_id isn&#8217;t set when the action is called.</p>
<p>I should also say there is a new &#8220;standard&#8221; way of testing for revisions and getting the original &#8220;real&#8221; post ID, however you still need to check that your plug-in fields are present in $_POST[] because they won&#8217;t be when the quick editor is used instead of the full post editor screen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizuka</title>
		<link>http://www.mikoder.com.au/2009/07/disappearing-custom-post-data/#comment-61</link>
		<dc:creator>lizuka</dc:creator>
		<pubDate>Fri, 02 Jul 2010 09:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikoder.com.au/?p=226#comment-61</guid>
		<description>Thanks for this tip which has helped me a lot :)
However I&#039;ve deleted all together the 2nd line of your code :
&lt;code&gt;if (!$post_id) $post_id = $_POST[&#039;post_ID&#039;];&lt;/code&gt;
because it didn&#039;t seem to be of any use.</description>
		<content:encoded><![CDATA[<p>Thanks for this tip which has helped me a lot <img src='http://www.mikoder.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
However I&#8217;ve deleted all together the 2nd line of your code :<br />
<code>if (!$post_id) $post_id = $_POST[&#039;post_ID&#039;];</code><br />
because it didn&#8217;t seem to be of any use.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

