<?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"
	>
<channel>
	<title>Comments on: Filters in WordPress</title>
	<atom:link href="http://mgeisler.net/2005/05/filters-in-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://mgeisler.net/2005/05/filters-in-wordpress/</link>
	<description>Adventures with Computers</description>
	<pubDate>Thu, 09 Feb 2012 18:29:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6-bleeding</generator>
		<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/2005/05/filters-in-wordpress/#comment-272</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Thu, 02 Jun 2005 07:10:13 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/2005/05/31/filters-in-wordpress/#comment-272</guid>
		<description>&lt;p&gt;Yep, I've noticed that your plugins are moving to XML, which I think it great!  And as you say: make fewer plugin hooks but make them better, or to say the same using other words: "less is more" :-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yep, I&#8217;ve noticed that your plugins are moving to XML, which I think it great!  And as you say: make fewer plugin hooks but make them better, or to say the same using other words: &#8220;less is more&#8221; :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis de Bernardy</title>
		<link>http://mgeisler.net/2005/05/filters-in-wordpress/#comment-270</link>
		<dc:creator>Denis de Bernardy</dc:creator>
		<pubDate>Wed, 01 Jun 2005 22:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/2005/05/31/filters-in-wordpress/#comment-270</guid>
		<description>&lt;p&gt;What you are describing is, more or less, what I'm doing with the latest versions of my plugins &lt;a href="http://www.semiologic.com/2005/05/30/fuzzy-recent-posts-updates-and-comments-now-xml-based/"&gt;fuzzy recent plugins&lt;/a&gt;, as well as what I'm doing in the upcoming version of my theme.&lt;/p&gt;

&lt;p&gt;Basically, I do something along the lines of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;apply all filters&lt;/li&gt;
&lt;li&gt;do php2xml&lt;/li&gt;
&lt;li&gt;if display is xml, return xml&lt;/li&gt;
&lt;li&gt;do xml2html&lt;/li&gt;
&lt;li&gt;echo html&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I might bypass the filtering system entirely in a next version of my theme, and do something along the lines of the following instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;$post = $post-&gt;apply_filters();&lt;/li&gt;
&lt;li&gt;... (as previous)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;as suggested in the hackers list a couple of days ago. this would assume a limited number of use cases could be defined. I can name three:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;'main' e.g. for use as a tile on a single page&lt;/li&gt;
&lt;li&gt;'abstract' e.g. for use in a list as a search result&lt;/li&gt;
&lt;li&gt;'title', e.g. for use in a list where only a title and subtitle are needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;there are possibly a few more. but not that many. in any event, this would significantly reduce the amount of plugin hooks, and do so for the better.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What you are describing is, more or less, what I&#8217;m doing with the latest versions of my plugins <a href="http://www.semiologic.com/2005/05/30/fuzzy-recent-posts-updates-and-comments-now-xml-based/">fuzzy recent plugins</a>, as well as what I&#8217;m doing in the upcoming version of my theme.</p>
<p>Basically, I do something along the lines of:</p>
<ul>
<li>apply all filters</li>
<li>do php2xml</li>
<li>if display is xml, return xml</li>
<li>do xml2html</li>
<li>echo html</li>
</ul>
<p>I might bypass the filtering system entirely in a next version of my theme, and do something along the lines of the following instead:</p>
<ul>
<li>$post = $post->apply_filters();</li>
<li>&#8230; (as previous)</li>
</ul>
<p>as suggested in the hackers list a couple of days ago. this would assume a limited number of use cases could be defined. I can name three:</p>
<ul>
<li>&#8216;main&#8217; e.g. for use as a tile on a single page</li>
<li>&#8216;abstract&#8217; e.g. for use in a list as a search result</li>
<li>&#8216;title&#8217;, e.g. for use in a list where only a title and subtitle are needed</li>
</ul>
<p>there are possibly a few more. but not that many. in any event, this would significantly reduce the amount of plugin hooks, and do so for the better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Geisler</title>
		<link>http://mgeisler.net/2005/05/filters-in-wordpress/#comment-269</link>
		<dc:creator>Martin Geisler</dc:creator>
		<pubDate>Wed, 01 Jun 2005 21:42:28 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/2005/05/31/filters-in-wordpress/#comment-269</guid>
		<description>&lt;p&gt;I've been doing some thinking myself about how a plugin system should
work.  For the filters it's evident that it is too simple to just have
a chain of functions doing "stuff" to the text.  We need more
structure, so that the "text" is in a well-defined format, and we need
to define what you can do to this text.&lt;/p&gt;

&lt;p&gt;Perhaps this could be done by defining an [XML][] format for the text,
and then all filters would modify this?  One could require that the
text is [XHTML][] at the beginning of the filter chain, and then the
filters should have access to a proper parser and only modify the text
through that.  I'm not that much into this stuff, but I believe that
this is what the &lt;a href="http://www.w3.org/Style/XSL/"&gt;XSL Transformation&lt;/a&gt; language lets you do.&lt;/p&gt;

&lt;p&gt;Of course, having all plugins modify the text using those style sheets
would make it a lot harder to write plugins.  Perhaps using full
stylesheets should be optional --- with the knowledge that the text is
(valid!) XHTML, the plugins will still be able to parse and change it
reliably without necessarily having to use an XML parser.&lt;/p&gt;

&lt;p&gt;I guess my ideas goes somewhat along the lines of the changes
&lt;a href="http://textdrive.com/pipermail/wp-hackers/2005-June/001229.html"&gt;outlined by Michel Fortin&lt;/a&gt; on the mailinglist: draw a line
somewhere and say: "Here we deal with the &lt;em&gt;raw input&lt;/em&gt; from the user,
and here we deal with &lt;em&gt;valid XHTML&lt;/em&gt;."  If such a division was actually
made, then lots of things would be easier.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been doing some thinking myself about how a plugin system should<br />
work.  For the filters it&#8217;s evident that it is too simple to just have<br />
a chain of functions doing &#8220;stuff&#8221; to the text.  We need more<br />
structure, so that the &#8220;text&#8221; is in a well-defined format, and we need<br />
to define what you can do to this text.</p>
<p>Perhaps this could be done by defining an [XML][] format for the text,<br />
and then all filters would modify this?  One could require that the<br />
text is [XHTML][] at the beginning of the filter chain, and then the<br />
filters should have access to a proper parser and only modify the text<br />
through that.  I&#8217;m not that much into this stuff, but I believe that<br />
this is what the <a href="http://www.w3.org/Style/XSL/">XSL Transformation</a> language lets you do.</p>
<p>Of course, having all plugins modify the text using those style sheets<br />
would make it a lot harder to write plugins.  Perhaps using full<br />
stylesheets should be optional &#8212; with the knowledge that the text is<br />
(valid!) XHTML, the plugins will still be able to parse and change it<br />
reliably without necessarily having to use an XML parser.</p>
<p>I guess my ideas goes somewhat along the lines of the changes<br />
<a href="http://textdrive.com/pipermail/wp-hackers/2005-June/001229.html">outlined by Michel Fortin</a> on the mailinglist: draw a line<br />
somewhere and say: &#8220;Here we deal with the <em>raw input</em> from the user,<br />
and here we deal with <em>valid XHTML</em>.&#8221;  If such a division was actually<br />
made, then lots of things would be easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Denis de Bernardy</title>
		<link>http://mgeisler.net/2005/05/filters-in-wordpress/#comment-267</link>
		<dc:creator>Denis de Bernardy</dc:creator>
		<pubDate>Wed, 01 Jun 2005 13:08:56 +0000</pubDate>
		<guid isPermaLink="false">http://mgeisler.net/2005/05/31/filters-in-wordpress/#comment-267</guid>
		<description>&lt;p&gt;I wish... ;) I might fork the plugin system with my CMS theme's next version.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I wish&#8230; ;) I might fork the plugin system with my CMS theme&#8217;s next version.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

