<?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: How to preset text in the WordPress post editor</title>
	<atom:link href="http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Fri, 10 Feb 2012 12:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Chris</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-593553</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sun, 05 Feb 2012 22:50:57 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-593553</guid>
		<description>How could I use this to pre-fill the Excerpt field? 

Thanks.</description>
		<content:encoded><![CDATA[<p>How could I use this to pre-fill the Excerpt field? </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-551266</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Wed, 04 Jan 2012 22:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-551266</guid>
		<description>I know this post is 3 years old, but I just wanted to say, I really appreciate this code very much!

The code is so simple &amp; still works perfect after all the WP updates over the last 3 years!

Great job!</description>
		<content:encoded><![CDATA[<p>I know this post is 3 years old, but I just wanted to say, I really appreciate this code very much!</p>
<p>The code is so simple &amp; still works perfect after all the WP updates over the last 3 years!</p>
<p>Great job!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Budden</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-535269</link>
		<dc:creator>Nick Budden</dc:creator>
		<pubDate>Tue, 27 Dec 2011 17:46:17 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-535269</guid>
		<description>This might be a weird addition, but I had to do this for a client&#039;s site, so this might help someone else. If you want to populate an empty editor with the category description, here&#039;s what you need to do:

`function preset_content() {
	global $post;
	$cat = get_the_category($post-&gt;ID);

	if(empty($cat))   {
	
		$default_content = &quot;Please save the post&#039;s category to show default content&quot;;
		
	} elseif ( $post-&gt;post_content == &quot;Please save the post&#039;s category to show default content&quot; and $post-&gt;post_type == &#039;post&#039; ) {
		$default_content = esc_attr($cat[0]-&gt;description);	
			
	} else {
		$default_content = $post-&gt;post_content;
	} 

	return $default_content;
}
add_filter(&#039;the_editor_content&#039;, &#039;preset_content&#039;);`</description>
		<content:encoded><![CDATA[<p>This might be a weird addition, but I had to do this for a client&#8217;s site, so this might help someone else. If you want to populate an empty editor with the category description, here&#8217;s what you need to do:</p>
<p>`function preset_content() {<br />
	global $post;<br />
	$cat = get_the_category($post-&gt;ID);</p>
<p>	if(empty($cat))   {</p>
<p>		$default_content = &#8220;Please save the post&#8217;s category to show default content&#8221;;</p>
<p>	} elseif ( $post-&gt;post_content == &#8220;Please save the post&#8217;s category to show default content&#8221; and $post-&gt;post_type == &#8216;post&#8217; ) {<br />
		$default_content = esc_attr($cat[0]-&gt;description);	</p>
<p>	} else {<br />
		$default_content = $post-&gt;post_content;<br />
	} </p>
<p>	return $default_content;<br />
}<br />
add_filter(&#8216;the_editor_content&#8217;, &#8216;preset_content&#8217;);`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 10 Useful WordPress Hook Hacks - Smashing Magazine &#124; Smashing Magazine</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-424027</link>
		<dc:creator>10 Useful WordPress Hook Hacks - Smashing Magazine &#124; Smashing Magazine</dc:creator>
		<pubDate>Mon, 19 Sep 2011 15:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-424027</guid>
		<description>[...] How to preset text in the WordPress post editor [...]</description>
		<content:encoded><![CDATA[<p>[...] How to preset text in the WordPress post editor [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicole</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-420887</link>
		<dc:creator>Nicole</dc:creator>
		<pubDate>Thu, 15 Sep 2011 13:52:26 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-420887</guid>
		<description>If you use custom post types (like I do) you can do this as well: 

&lt;pre&gt;&lt;code&gt;add_filter( &#039;default_content&#039;, &#039;my_editor_content&#039; );

function my_editor_content( $content ) {

    global $post_type;

    switch( $post_type ) {
        case &#039;sources&#039;:
            $content = &#039;your content&#039;;
        break;
        case &#039;stories&#039;:
            $content = &#039;your content&#039;;
        break;
        case &#039;pictures&#039;:
            $content = &#039;your content&#039;;
        break;
        default:
            $content = &#039;your default content&#039;;
        break;
    }

    return $content;
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>If you use custom post types (like I do) you can do this as well: </p>
<pre><code>add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {

    global $post_type;

    switch( $post_type ) {
        case 'sources':
            $content = 'your content';
        break;
        case 'stories':
            $content = 'your content';
        break;
        case 'pictures':
            $content = 'your content';
        break;
        default:
            $content = 'your default content';
        break;
    }

    return $content;
}</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jose</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-416052</link>
		<dc:creator>Jose</dc:creator>
		<pubDate>Fri, 09 Sep 2011 14:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-416052</guid>
		<description>Justin,

You&#039;re a life saver. Thanks for taking on the challenge. This tiny feature made a huge difference!!! 

Thanks again, 
Jose</description>
		<content:encoded><![CDATA[<p>Justin,</p>
<p>You&#8217;re a life saver. Thanks for taking on the challenge. This tiny feature made a huge difference!!! </p>
<p>Thanks again,<br />
Jose</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riaan</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-382393</link>
		<dc:creator>Riaan</dc:creator>
		<pubDate>Wed, 20 Jul 2011 17:12:51 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-382393</guid>
		<description>You, sir, are a legend. Thank you for this amazing tip!</description>
		<content:encoded><![CDATA[<p>You, sir, are a legend. Thank you for this amazing tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shun the Plugin: 100 WordPress Code Snippets from Across the Net &#124; WordPress, Multisite and BuddyPress plugins, themes, news and help &#8211; WPMU.org</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-292385</link>
		<dc:creator>Shun the Plugin: 100 WordPress Code Snippets from Across the Net &#124; WordPress, Multisite and BuddyPress plugins, themes, news and help &#8211; WPMU.org</dc:creator>
		<pubDate>Wed, 09 Feb 2011 21:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-292385</guid>
		<description>[...] Source: Justin Tadlock [...]</description>
		<content:encoded><![CDATA[<p>[...] Source: Justin Tadlock [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Killer hacks to enhance WordPress editor - CatsWhoCode.com</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-288206</link>
		<dc:creator>Killer hacks to enhance WordPress editor - CatsWhoCode.com</dc:creator>
		<pubDate>Mon, 31 Jan 2011 15:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-288206</guid>
		<description>[...] you enjoyed this post, make sure to subscribe to my rss feed.&quot;; return $content; } &#187; Source: http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editorAdd your language to spell checkBy default, WordPress have an English spellchecker so you can check [...]</description>
		<content:encoded><![CDATA[<p>[...] you enjoyed this post, make sure to subscribe to my rss feed.&quot;; return $content; } &raquo; Source: <a href="http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editorAdd" rel="nofollow">http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editorAdd</a> your language to spell checkBy default, WordPress have an English spellchecker so you can check [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chantal</title>
		<link>http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-283008</link>
		<dc:creator>Chantal</dc:creator>
		<pubDate>Fri, 21 Jan 2011 20:14:01 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1593#comment-283008</guid>
		<description>@zach &quot;I tried it in the WordPress editor, my screen went completely white. &quot;

I had the same issue. Use the code provided by &lt;a href=&quot;http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-208674&quot; rel=&quot;nofollow&quot;&gt;Grof&lt;/a&gt;

Type in your content like so:

&lt;pre&gt;&lt;code&gt;$default_content = &#039; Title of the first paragraph
	write your first paragraph here&lt;/code&gt;&lt;/pre&gt;

Don&#039;t use the  tag that screws up the code.</description>
		<content:encoded><![CDATA[<p>@zach &#8220;I tried it in the WordPress editor, my screen went completely white. &#8221;</p>
<p>I had the same issue. Use the code provided by <a href="http://justintadlock.com/archives/2009/04/05/how-to-preset-text-in-the-wordpress-post-editor#comment-208674" rel="nofollow">Grof</a></p>
<p>Type in your content like so:</p>
<pre><code>$default_content = ' Title of the first paragraph
	write your first paragraph here</code></pre>
<p>Don&#8217;t use the  tag that screws up the code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

