<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>seanklein.org &#187; PHP</title>
	<atom:link href="http://seanklein.org/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanklein.org</link>
	<description></description>
	<lastBuildDate>Sat, 19 May 2012 14:08:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>WordPress Autosave</title>
		<link>http://seanklein.org/2010/11/wordpress-autosave/</link>
		<comments>http://seanklein.org/2010/11/wordpress-autosave/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 17:14:12 +0000</pubDate>
		<dc:creator>Sean Klein</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Things I've Learned]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[autosave]]></category>
		<category><![CDATA[TIL]]></category>
		<category><![CDATA[wordpress plugins]]></category>

		<guid isPermaLink="false">http://seanklein.org/?p=75</guid>
		<description><![CDATA[Recently I was having an issue with the WordPress autosave running on my posts in a custom post type.  I am running a lot of scripts in the &#8220;save_post&#8221; action and couldn&#8217;t find a good way to exclude autosaves from running this code. Note that I looked at the info being passed to the functions&#8230;]]></description>
			<content:encoded><![CDATA[<p>Recently I was having an issue with the WordPress autosave running on my posts in a custom post type.  I am running a lot of scripts in the &#8220;save_post&#8221; action and couldn&#8217;t find a good way to exclude autosaves from running this code.</p>
<p>Note that I looked at the info being passed to the functions and the usual suspects for looking at wether it was an autosave or not weren&#8217;t helping.</p>
<p>My biggest problem came when typing a title in the custom post type, then clicking outside of the title field.  Normally this kicks off the autosave feature automatically so the post permalink can be established and displayed below the post title.  Since I wasn&#8217;t using this custom post type on the front of end of the site, I really didn&#8217;t care about that.</p>
<p>So now for the easiest way to disable autosave for the custom post type:</p>
<pre class="prettyprint">
function seans_admin_init() {
	if (!empty($_GET['post']) || (!empty($_GET['post_type']) &#038;&#038; $_GET['post_type'] == '[custom_post_type]')) {
		$post_type = '';

		if (!empty($_GET['post'])) {
			$post_type = get_post_type(intval($_GET['post']));
		}
		else if (!empty($_GET['post_type'])) {
			$post_type = $_GET['post_type'];
		}

		if (!empty($post_type) &#038;&#038; $post_type == '[custom_post_type]') {
			// Hi, I block Autosave from running on posts
			wp_deregister_script('autosave');
		}
	}

}
add_action('admin_init', 'seans_admin_init');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanklein.org/2010/11/wordpress-autosave/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TIL: Adding Admin Menu Pages</title>
		<link>http://seanklein.org/2009/07/til-adding-admin-menu-pages/</link>
		<comments>http://seanklein.org/2009/07/til-adding-admin-menu-pages/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 16:29:56 +0000</pubDate>
		<dc:creator>Sean Klein</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Things I've Learned]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[admin pages]]></category>

		<guid isPermaLink="false">http://seanklein.org/?p=32</guid>
		<description><![CDATA[When using functions like add_submenu_page etc, make sure that you add them at the admin_menu action. If you try to add them any place other than that you will get &#8220;Insufficient Privileges&#8221; errors when trying to go to the page. NOTE: If you are in WP 2.8 WordPress allows you to run those functions at&#8230;]]></description>
			<content:encoded><![CDATA[<p>When using functions like add_submenu_page etc, make sure that you add them at the admin_menu action.  If you try to add them any place other than that you will get &#8220;Insufficient Privileges&#8221; errors when trying to go to the page.</p>
<p>NOTE: If you are in WP 2.8 WordPress allows you to run those functions at admin_init, but don&#8217;t be fooled they will break again in WP 2.8.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanklein.org/2009/07/til-adding-admin-menu-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Media Gallery</title>
		<link>http://seanklein.org/2009/07/wordpress-media-gallery/</link>
		<comments>http://seanklein.org/2009/07/wordpress-media-gallery/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 19:45:45 +0000</pubDate>
		<dc:creator>Sean Klein</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Things I've Learned]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[media gallery]]></category>
		<category><![CDATA[uploading]]></category>

		<guid isPermaLink="false">http://seanklein.org/?p=29</guid>
		<description><![CDATA[For the WordPress Media Gallery to work properly on a server, PHP Safe Mode must be turned off.  From what I am told when PHP Safe mode is on, PHP runs as a different user than apache and this causes folder creation/modification problems.  So for the uploader to work it must be turned off. Also&#8230;]]></description>
			<content:encoded><![CDATA[<p>For the WordPress Media Gallery to work properly on a server, PHP Safe Mode must be turned off.  From what I am told when PHP Safe mode is on, PHP runs as a different user than apache and this causes folder creation/modification problems.  So for the uploader to work it must be turned off.</p>
<p>Also I have noticed some issue in the past with the flash uploader and it displaying HTTP Errors.  I have found that if the server is protected by 401 Authentication this happens.  I am sure that there are other problems that cause this, but this is the first fix I have found in my troubleshooting.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanklein.org/2009/07/wordpress-media-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

