<?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: Saving Wordpress Plugin Options &#8211; Admin Panels Done Right</title>
	<atom:link href="http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/feed/" rel="self" type="application/rss+xml" />
	<link>http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/</link>
	<description></description>
	<lastBuildDate>Mon, 12 Jul 2010 12:35:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter</title>
		<link>http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/comment-page-1/#comment-961</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 25 May 2009 16:59:18 +0000</pubDate>
		<guid isPermaLink="false">http://apartmentonesix.com/?p=120#comment-961</guid>
		<description>Well played.  You&#039;re probably right about the reality of the processing power of performing a single if statement on init - but I think there will always be a little voice in my head yelling every time I do it when I don&#039;t absolutely have to :).

You also raise some valid points about using current_user_can - I often forget that many WordPress users take advantage of roles - it&#039;s important to make sure you&#039;re not giving too much power to the underlings.</description>
		<content:encoded><![CDATA[<p>Well played.  You&#8217;re probably right about the reality of the processing power of performing a single if statement on init &#8211; but I think there will always be a little voice in my head yelling every time I do it when I don&#8217;t absolutely have to <img src='http://apartmentonesix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>You also raise some valid points about using current_user_can &#8211; I often forget that many WordPress users take advantage of roles &#8211; it&#8217;s important to make sure you&#8217;re not giving too much power to the underlings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Ohrn</title>
		<link>http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/comment-page-1/#comment-960</link>
		<dc:creator>Nick Ohrn</dc:creator>
		<pubDate>Mon, 25 May 2009 16:47:48 +0000</pubDate>
		<guid isPermaLink="false">http://apartmentonesix.com/?p=120#comment-960</guid>
		<description>To be honest, a simple if statement on a value available globally isn&#039;t going to be a bottleneck at all compared to all the other stuff that goes on when WP loads.  Also, you can hook to admin_init to make sure it only happens on admin page loads.

To make sure that the correct form is also getting submitted and the user actually was accessing the form, you can use a combination of &#039;check_admin_referer&#039; and &#039;current_user_can&#039;.  I initially left those out of my description because I didn&#039;t really feel like bogging down my approach.  You should be using those things anyways, though, regardless of how you check for submission.</description>
		<content:encoded><![CDATA[<p>To be honest, a simple if statement on a value available globally isn&#8217;t going to be a bottleneck at all compared to all the other stuff that goes on when WP loads.  Also, you can hook to admin_init to make sure it only happens on admin page loads.</p>
<p>To make sure that the correct form is also getting submitted and the user actually was accessing the form, you can use a combination of &#8216;check_admin_referer&#8217; and &#8216;current_user_can&#8217;.  I initially left those out of my description because I didn&#8217;t really feel like bogging down my approach.  You should be using those things anyways, though, regardless of how you check for submission.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/comment-page-1/#comment-950</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Sun, 24 May 2009 20:50:52 +0000</pubDate>
		<guid isPermaLink="false">http://apartmentonesix.com/?p=120#comment-950</guid>
		<description>You&#039;re right Nick - letting WordPress do all the dirty work precludes the ability to do any real validation, or fancy manipulation.  However, for most  admin panels, I&#039;ve found that it still works ok.

I&#039;m intrigued by your approach though - I definitely like the idea of using a $_GET variable to indicate an update, as it&#039;s always helpful to tell the user what has been updated.  I&#039;m a little skeptical about running it on init though - since init runs on every page load, both front and back, we&#039;re adding the extra overhead of checking for the $_POSTed variable on every page load - even ajax calls.  Also - depending on what you&#039;re doing, you&#039;ll need to do some extra validation to make sure the call is coming from the right place, and whoever is making the call has the proper permissions to do so (again, because running from init, it could be accessible from the front end).

If I do need to do some extra data manipulation on posted variables from an admin page, I usually opt to put the code at the top of my admin panel display function, and post the form to itself with action=&quot;&quot;.  That way, I know the code is only going to be run from that particular admin page, and anybody trying to get to it from outside will have to deal with WordPress&#039; authentication functions.

I&#039;d be interested to hear if I&#039;m way off base with this though (heck, I&#039;d be interested to hear if I&#039;m even a little off base), and your thoughts about my concerns on running on init.  New ideas always help, and you definitely seem to know what you&#039;re talking about.

Either way, thanks for stopping by and commenting!</description>
		<content:encoded><![CDATA[<p>You&#8217;re right Nick &#8211; letting WordPress do all the dirty work precludes the ability to do any real validation, or fancy manipulation.  However, for most  admin panels, I&#8217;ve found that it still works ok.</p>
<p>I&#8217;m intrigued by your approach though &#8211; I definitely like the idea of using a $_GET variable to indicate an update, as it&#8217;s always helpful to tell the user what has been updated.  I&#8217;m a little skeptical about running it on init though &#8211; since init runs on every page load, both front and back, we&#8217;re adding the extra overhead of checking for the $_POSTed variable on every page load &#8211; even ajax calls.  Also &#8211; depending on what you&#8217;re doing, you&#8217;ll need to do some extra validation to make sure the call is coming from the right place, and whoever is making the call has the proper permissions to do so (again, because running from init, it could be accessible from the front end).</p>
<p>If I do need to do some extra data manipulation on posted variables from an admin page, I usually opt to put the code at the top of my admin panel display function, and post the form to itself with action=&#8221;".  That way, I know the code is only going to be run from that particular admin page, and anybody trying to get to it from outside will have to deal with WordPress&#8217; authentication functions.</p>
<p>I&#8217;d be interested to hear if I&#8217;m way off base with this though (heck, I&#8217;d be interested to hear if I&#8217;m even a little off base), and your thoughts about my concerns on running on init.  New ideas always help, and you definitely seem to know what you&#8217;re talking about.</p>
<p>Either way, thanks for stopping by and commenting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Ohrn</title>
		<link>http://apartmentonesix.com/2009/04/saving-wordpress-plugin-options-admin-panels-done-right/comment-page-1/#comment-949</link>
		<dc:creator>Nick Ohrn</dc:creator>
		<pubDate>Sun, 24 May 2009 19:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://apartmentonesix.com/?p=120#comment-949</guid>
		<description>The only problem with this approach is validation of the data that the user enters.  You don&#039;t get to do any.  I usually just check for the appropriate $_POST variable in init, save the options appropriately, and then use a redirect to the admin page with an $_GET variable indicating an update happened.</description>
		<content:encoded><![CDATA[<p>The only problem with this approach is validation of the data that the user enters.  You don&#8217;t get to do any.  I usually just check for the appropriate $_POST variable in init, save the options appropriately, and then use a redirect to the admin page with an $_GET variable indicating an update happened.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
