<?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>scribu &#187; Front-end Editor</title>
	<atom:link href="http://scribu.net/wordpress/front-end-editor/feed" rel="self" type="application/rss+xml" />
	<link>http://scribu.net</link>
	<description>Hello, this is where scribu geeks out</description>
	<lastBuildDate>Thu, 11 Mar 2010 13:48:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Common Mistakes In Themes</title>
		<link>http://scribu.net/wordpress/front-end-editor/common-mistakes-in-themes.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/common-mistakes-in-themes.html#comments</comments>
		<pubDate>Thu, 25 Feb 2010 13:09:57 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=622</guid>
		<description><![CDATA[Although Front-end Editor tries to be compatible with as many themes as possible, there&#8217;s only so much it can do.
No wp_footer() call
Lots of plugins, including this one, rely on the wp_footer() call to include their JavaScript files. Open your theme&#8217;s footer.php file and make sure you have this line somewhere:

&#60;?php wp_footer&#40;&#41;; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>Although Front-end Editor tries to be compatible with as many themes as possible, there&#8217;s only so much it can do.</p>
<h3>No wp_footer() call</h3>
<p>Lots of plugins, including this one, rely on the <code>wp_footer()</code> call to include their JavaScript files. Open your theme&#8217;s <code>footer.php</code> file and make sure you have this line somewhere:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Using the_title() in the wrong places</h3>
<p>A mistake I see in a lot of themes is code like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;</pre></div></div>

<p>This causes all sorts of problems. You should use <code>the_title_attribute()</code> instead:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_attribute<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;</pre></div></div>

<h3>No id &#038; class attributes for dynamic sidebars</h3>
<p>If you want to have editable text widgets, you&#8217;ll have to change code like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Sidebar'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h4&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h4&gt;'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>to this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Sidebar'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h4&gt;'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h4&gt;'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can use &lt;li&gt;s instead of &lt;div&gt;s. The important part is <code>id="%1$s" class="widget %2$s"</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/common-mistakes-in-themes.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Version 1.7</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-7.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-7.html#comments</comments>
		<pubDate>Thu, 18 Feb 2010 00:56:40 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=617</guid>
		<description><![CDATA[If your theme supports native thumbnails (introduced in WordPress 2.9), you will be able to change them by double-clicking on them. Also, you now have editable_option().]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s get right into it:</p>
<h3>Post thumbnail switching</h3>
<p>If your theme supports <a href="http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/">native thumbnails</a> (introduced in WordPress 2.9), you will be able to change them by double-clicking on them.</p>
<h3>Editable options</h3>
<p>Similarly to editable_images(), you can now have editable bits of text anywhere in your theme. For example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blurb'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
[...]
&nbsp;
Today's mood: <span style="color: #000000; font-weight: bold;">&lt;?php</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mood'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>It&#8217;s like text widgets, without the widgets. <img src='http://scribu.net/wp/wp-content/plugins/ym_smilies/images/yahoo_smiley.gif' alt='&#58;&#45;&#41; ' class='wp-smiley' width='18' height='18' title='&#58;&#45;&#41; ' /></p>
<h3>No more autogrow</h3>
<p>If you&#8217;ve been using the basic text editor, you&#8217;ve probably had your share of frustration with the autogrow script. After switching from Autogrow to Growfield without much improvement, I&#8217;ve decided to stick to a normal textarea with a scrollbar.</p>
<p>The rich editor is not affected by this.</p>
<h3>Configurable nicEdit</h3>
<p>I&#8217;ve added two buttons to the rich editor panel: font-family and font-color. More importantly, you can now select which buttons you want to use. Just paste this code in your theme&#8217;s functions.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> configure_fee_nicedit<span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'buttonList'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'bold'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'italic'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'strikethrough'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'left'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'center'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'right'</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$config</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'front_end_editor_nicedit'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'configure_fee_nicedit'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>See the available <a href="http://nicedit.pbworks.com/Configuration+Options">configuration options</a>.</p>
<h3>Upgrade instructions</h3>
<p>If you have custom code written for the plugin, read on:</p>
<p>Renamed hooks:</p>
<p>front_ed_fields -> front_end_editor_fields<br />
front_ed_allow -> front_end_editor_allow<br />
front_ed_disable -> front_end_editor_disable</p>
<p>Renamed CSS classes:</p>
<p>.front-ed -> .fee-field<br />
.front-ed-{filter} -> .fee-filter-{filter}<br />
.front-ed-container -> .fee-form</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 1.6</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-6.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-6.html#comments</comments>
		<pubDate>Fri, 01 Jan 2010 12:10:39 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=607</guid>
		<description><![CDATA[The number of editable elements continues to grow with this version of your favourite inline editor for WordPress:

Besides tags and terms, you can now edit categories as well, using the same interface. They all have autosuggest enabled, to make it easier to work with.

Custom fields with multiple values can also be edited now.]]></description>
			<content:encoded><![CDATA[<p>The number of editable elements continues to grow with this version of your favourite inline editor for WordPress:</p>
<p>Besides tags and terms, you can now edit categories as well, using the same interface. They all have autosuggest enabled, to make it easier to work with.</p>
<p>Custom fields with multiple values can also be edited now. Here&#8217;s a code example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> get_editable_post_meta<span style="color: #009900;">&#40;</span>get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_key'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$value</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>Finally, you can now edit all widget titles, not just titles of text widgets.</p>
<p>Other enhancements:</p>
<ul>
<li>optimized script loading</li>
<li>fixed issue with Internet Explorer</li>
<li>fixed issue with comment paragraphs</li>
<li>fixed issues with the <code>$post</code> global</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-6.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Developer Guide</title>
		<link>http://scribu.net/wordpress/front-end-editor/developer-guide.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/developer-guide.html#comments</comments>
		<pubDate>Sun, 20 Dec 2009 16:05:01 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=467</guid>
		<description><![CDATA[This post contains technical information for developers who want to create their own editable fields.]]></description>
			<content:encoded><![CDATA[<div class="notice">editable_option() has been integrated into version 1.7</div>
<p>This post contains technical information for developers who want to add their own editable fields.</p>
<p>We&#8217;re going to enable any option to be editable from the front-end.</p>
<h4>The filter</h4>
<p>The essential element of each editable field is a WordPress filter. You can use either an <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">existing filter</a>, or a custom one.</p>
<p>We&#8217;re going to use a new one:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editable_option'</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, <code>editable_option()</code> simply wraps the value returned by get_option() in a filter.</p>
<p>In your theme, you can now write:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my_option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
&nbsp;
&lt;p&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'my_other_option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;</pre></div></div>

<p><span id="more-467"></span></p>
<h4>The class</h4>
<p>Each editable field needs a class to handle retrieving and saving the edited content.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> My_Editable_Option <span style="color: #000000; font-weight: bold;">extends</span> FEE_Field_Base <span style="color: #009900;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	 * The type of object we're editing
	 * @return string
	 */</span>
	static <span style="color: #000000; font-weight: bold;">function</span> get_object_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'option'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when generating the HTML on the front-end
	 * Wraps the $content in special markup, if the user has the right permissions
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> wrap<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">placeholder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> parent<span style="color: #339933;">::</span><span style="color: #004000;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when a user double-clicks on an editable field
	 * Fetches the content to be edited
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when a user clicks the &quot;Save&quot; button
	 * Saves the modified content and then returns it
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		update_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">placeholder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called at each step
	 * Confirms that the current user has the right permissions to edit the field
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> check<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'manage_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, it&#8217;s pretty easy. There are a few other aspects that you can learn by looking at the built-in classes as reference. They can be found in the <a href="http://plugins.trac.wordpress.org/browser/front-end-editor/trunk/fields/">fields folder</a>.</p>
<h4>Connecting the dots</h4>
<p>Now all we need to do is to connect the class to the filter. Here&#8217;s how you do this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> register_my_field<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_fronted_field<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editable_option'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My_Editable_Option'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Option'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'input'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'argc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2</span>
	<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'front_end_editor_fields'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'register_my_field'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here are the arguments you can set for <code>register_fronted_field()</code>:</p>
<ul>
<li><strong>class</strong> &#8211; the class which will handle the editing (mandatory)</li>
<li><strong>title</strong> &#8211; the field title (mandatory)</li>
<li><strong>type</strong> &#8211; input | textarea | rich (default: input)</li>
<li><strong>priority</strong> &#8211; the filter priority (default: 11)</li>
<li><strong>argc</strong> &#8211; number of args the filter accepts (default: 1)</li>
</ul>
<h4>Putting it all together</h4>
<p>Here&#8217;s all the code put together. Add it to your theme&#8217;s <code>functions.php</code> and &#8216;My Option&#8217; should appear in the list of fields on the plugin settings page:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> editable_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editable_option'</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> My_Editable_Option <span style="color: #000000; font-weight: bold;">extends</span> FEE_Field_Base <span style="color: #009900;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	 * The type of object we're editing
	 * @return string
	 */</span>
	static <span style="color: #000000; font-weight: bold;">function</span> get_object_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'option'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when generating the HTML on the front-end
	 * Wraps the $content in special markup, if the user has the right permissions
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> wrap<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">check</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">placeholder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> parent<span style="color: #339933;">::</span><span style="color: #004000;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when a user double-clicks on an editable field
	 * Fetches the content to be edited
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called when a user clicks the &quot;Save&quot; button
	 * Saves the modified content and then returns it
	 * @return string
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> save<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		update_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">placeholder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Called at each step
	 * Confirms that the current user has the right permissions to edit the field
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> check<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'manage_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> register_my_field<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_fronted_field<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'editable_option'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My_Editable_Option'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Option'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'input'</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'argc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2</span>
	<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'front_ed_fields'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'register_my_field'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h4>Giving back</h4>
<p>If you write a new editable field that you think will be useful for other users, post it in the support forum. I might include it in a future release of the plugin, giving you credit for it, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/developer-guide.html/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Version 1.5</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-5.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-5.html#comments</comments>
		<pubDate>Sun, 29 Nov 2009 15:27:54 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=594</guid>
		<description><![CDATA[Straight from the lab, we bring you the latest and greatest in front-end editing:

Currently, there is no easy way to change an image from your theme. You have to either override the image file through FTP or locate the code in your theme and modify it.]]></description>
			<content:encoded><![CDATA[<p>Straight from the lab, we bring you the latest and greatest in front-end editing:</p>
<h3>Swap theme images</h3>
<p>Currently, there is no easy way to change an image from your theme. You have to either override the image file through FTP or locate the code in your theme and modify it.</p>
<p>Wouldn&#8217;t it be nice if you could just double-click on the image you want to change and then just do it, without leaving the page you&#8217;re on?</p>
<p>Good news: now you can, with a little bit of tweaking. To make an image editable, you have to make a one-time edit to your theme. </p>
<p><span id="more-594"></span></p>
<p>I chose the <a href="http://cutline.tubetorial.com/">Cutline</a> theme as an example:</p>
<p>In header.php, I replaced this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;img src=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/images/header_1.jpg&quot; width=&quot;970&quot; height=&quot;140&quot; alt=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> header image 1&quot; title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> header image 1&quot; /&gt;</pre></div></div>

<p>with this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> editable_image<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'header-1'</span><span style="color: #339933;">,</span> 
	get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/images/header_1.jpg'</span><span style="color: #339933;">,</span> 
	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">970</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'height'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">140</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'alt'</span> <span style="color: #339933;">=&gt;</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The first argument is the image name<br />
The second argument is the default URL<br />
The third argument is optional and it&#8217;s used for adding extra attributes to the &lt;img&gt; element.</p>
<p>Now, when I double-click on the header image, the Media Library box pops up. From there, I can choose any image I want to put instead of the current one:</p>
<p><img src="http://img686.imageshack.us/img686/153/screenshot2s.png" alt="image swapping" /></p>
<h3>NicEdit is in, jWYSIWYG is out</h3>
<p><a href="http://nicedit.com">NicEdit</a> is a more mature visual editor than <a href="http://code.google.com/p/jwysiwyg">jWYSIWYG</a>, but still lightweight. </p>
<p><img src="http://img686.imageshack.us/img686/6445/screenshot1f.png" alt="visual editing" /></p>
<p>Two important benefits:</p>
<ul>
<li><strong>more inline than ever</strong>: when editing the post content, the editor preserves all the styles from your theme, making it even more seamless</li>
<li><strong>autogrow for all</strong>: autogrow is native to NicEdit, which means that it should work reliably in all browsers</li>
</ul>
<h3>Other improvements</h3>
<ul>
<li>improved single paragraph editing</li>
<li>better handling of text widgets</li>
<li>compress JS &#038; CSS for faster loading</li>
<li>compatibility with Ajaxed WordPress plugin</li>
<li>added Estonian translation, by Aivar Luht</li>
</ul>
<p>If you&#8217;re having trouble with the new version or have a feature request, hit the <a href="http://wordpress.org/tags/front-end-editor">support forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 1.4</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-4.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-4.html#comments</comments>
		<pubDate>Fri, 06 Nov 2009 14:59:43 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=584</guid>
		<description><![CDATA[Over the last several weeks, there has been a steady stream of improvements going into Front-end Editor, largely as a result of your feedback. I&#8217;m happy to see people are using the plugin in interesting ways.]]></description>
			<content:encoded><![CDATA[<p>Over the last several weeks, there has been a steady stream of improvements going into Front-end Editor, largely as a result of your feedback. I&#8217;m happy to see people are using the plugin in interesting ways.</p>
<p>First of, several users requested a way to allow only certain posts to be editable. This is easily done now, with a few lines of code. See examples <a href="http://wordpress.org/support/topic/321626?replies=20#post-1263527">here</a>.</p>
<p>Secondly, there are two new editable fields: If you&#8217;re on a category archive and your theme uses <code>single_cat_title()</code>, you will be able to edit the category title on the spot. The same goes for tags.</p>
<p>Other improvements:</p>
<ul>
<li>added $echo parameter to <code>editable_post_meta()</code></li>
<li>don&#8217;t load CSS or JS if the current user can&#8217;t edit any of the fields</li>
<li>switched from Autogrow to Growfield (fixes IE compatibility)</li>
<li>added Georgian translation (thanks to Levani Melikishvili)</li>
</ul>
<p>Thanks to those who suggested improvements and did beta testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 1.3</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-3.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-3.html#comments</comments>
		<pubDate>Thu, 24 Sep 2009 19:13:51 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=558</guid>
		<description><![CDATA[A new release with a lot of small but noticeable improvements, like editable site title and description.]]></description>
			<content:encoded><![CDATA[<p>A new release with a lot of small but noticeable improvements:</p>
<h3>Two new editable fields</h3>
<p>In version 1.3, you can also edit your site&#8217;s title and description. You won&#8217;t go changing those very often, but it&#8217;s nice to know you can. <img src='http://scribu.net/wp/wp-content/plugins/ym_smilies/images/yahoo_smiley.gif' alt='&#58;&#41; ' class='wp-smiley' width='18' height='18' title='&#58;&#41; ' /></p>
<h3>Skinable WYSIWYG editor</h3>
<p>The rich text editor now respects image alignment. What&#8217;s more, you can make the editor window look however you want. Just add your own CSS into a file named <code>front-end-editor.css</code> and place it in your theme&#8217;s directory.</p>
<p>If you&#8217;re a JavaScript ninja, you can go even further and tweak it&#8217;s behaviour using <a href="http://scribu.net/wordpress/event-pooling-with-wordpress.html">event triggers</a> baked into the new version. See /inc/editor/editor.js.</p>
<h3>Slug updating</h3>
<p>When you edit a post, the post&#8217;s slug will also be updated, when appropriate. For example, say you have a post titled &#8220;My Greatest Post Ever&#8221;.</p>
<p>If the slug is the default one -  &#8220;my-greatest-post-ever&#8221; &#8211; and you change the title, the slug will also be updated.</p>
<p>But, if you had previously set the slug to &#8220;greatest-post&#8221;, it will remain unchanged when you edit the title.</p>
<h3>Other improvements</h3>
<ul>
<li>option to disable highlighting</li>
<li>compatibility with the postThumbs plugin</li>
<li>added Polish translation</li>
<li>better XHTML markup</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-3.html/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Version 1.2</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-2.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-2.html#comments</comments>
		<pubDate>Tue, 25 Aug 2009 16:37:08 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=548</guid>
		<description><![CDATA[As you might have noticed, a lot of work is going into this plugin:
Version 1.2 adds another editable field &#8211; the author description.]]></description>
			<content:encoded><![CDATA[<p>As you might have noticed, a lot of work is going into this plugin:</p>
<p>Version 1.2 adds another editable field &#8211; the author description. It works if you have this somewhere in your theme:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">the_author_meta<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Or, if you&#8217;re on an older version of WordPress:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">the_author_description<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Besides that, several other improvements have been included:</p>
<ul>
<li>while hovering over editable field, it will be highlighted</li>
<li>added experimental wysiwyg autogrow</li>
<li>it should generate valid xHTML</li>
<li>html code is cleaned up before saving</li>
<li>added Portuguese translation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-2.html/feed</wfw:commentRss>
		<slash:comments>71</slash:comments>
		</item>
		<item>
		<title>Version 1.1</title>
		<link>http://scribu.net/wordpress/front-end-editor/fee-1-1.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/fee-1-1.html#comments</comments>
		<pubDate>Sat, 15 Aug 2009 14:05:33 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=539</guid>
		<description><![CDATA[Version 1.1 adds a few usability improvements, such as a loading graphic and hotkeys.]]></description>
			<content:encoded><![CDATA[<p>Version 1.1 adds a few usability improvements:</p>
<ul>
<li> a spinner is displayed while loading and saving data</li>
<li> pressing escape while editing will remove the form</li>
<li> pressing enter while editing a text input will submit the form</li>
</ul>
<p>Also, it allows you to edit custom taxonomies, just like you would edit post tags. I recommend the <a href="http://yoast.com/wordpress/simple-taxonomies/">Simple Taxonomies</a> plugin for creating custom taxonomies.</p>
<p>Here is a code example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_terms<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytax'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>To make it work in WP 2.8 *, you have to open <code>wp-includes/category-template.php</code> and find the_terms() function. Then, you have to make it look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> the_terms<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$taxonomy</span><span style="color: #339933;">,</span> <span style="color: #000088;">$before</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sep</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$after</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$term_list</span> <span style="color: #339933;">=</span> get_the_term_list<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$taxonomy</span><span style="color: #339933;">,</span> <span style="color: #000088;">$before</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sep</span><span style="color: #339933;">,</span> <span style="color: #000088;">$after</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_wp_error<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$term_list</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_terms'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$term_list</span><span style="color: #339933;">,</span> <span style="color: #000088;">$taxonomy</span><span style="color: #339933;">,</span> <span style="color: #000088;">$before</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sep</span><span style="color: #339933;">,</span> <span style="color: #000088;">$after</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>____<br />
* You don&#8217;t have to do this if you&#8217;re using WordPress 2.9 or newer (see <a href="http://core.trac.wordpress.org/ticket/10600">#10600</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/fee-1-1.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Loading only on certain pages</title>
		<link>http://scribu.net/wordpress/front-end-editor/loading-only-on-certain-pages.html</link>
		<comments>http://scribu.net/wordpress/front-end-editor/loading-only-on-certain-pages.html#comments</comments>
		<pubDate>Tue, 07 Jul 2009 13:25:32 +0000</pubDate>
		<dc:creator>scribu</dc:creator>
				<category><![CDATA[Front-end Editor]]></category>

		<guid isPermaLink="false">http://scribu.net/?p=514</guid>
		<description><![CDATA[Here is a foolproof way to make only parts of your site editable:

function front_editor_disable&#40;&#41; &#123;
	if &#40; ! is_single&#40;&#41; &#41;
		return true;
&#125;
add_filter&#40;'front_end_editor_disable', 'front_editor_disable'&#41;;

Just add that code in your theme&#8217;s functions.php file and you&#8217;re good to go: the plugin will work only on single posts.
Feel free to replace is_single() with whatever condition you need.
]]></description>
			<content:encoded><![CDATA[<p>Here is a foolproof way to make only parts of your site editable:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> front_editor_disable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'front_end_editor_disable'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'front_editor_disable'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Just add that code in your theme&#8217;s <em>functions.php</em> file and you&#8217;re good to go: the plugin will work only on single posts.</p>
<p>Feel free to replace <code>is_single()</code> with whatever condition you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://scribu.net/wordpress/front-end-editor/loading-only-on-certain-pages.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
