<?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>redconfettipermalinks | redconfetti</title>
	<atom:link href="http://www.redconfetti.com/tag/permalinks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redconfetti.com</link>
	<description>the journal of maxwell keyes</description>
	<lastBuildDate>Tue, 24 Jan 2012 17:04:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress Plugin &#8211; Custom Pages?</title>
		<link>http://www.redconfetti.com/2010/06/wordpress-plugin-custom-pages/</link>
		<comments>http://www.redconfetti.com/2010/06/wordpress-plugin-custom-pages/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 02:39:15 +0000</pubDate>
		<dc:creator>redconfetti</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[permalinks]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.redconfetti.com/?p=500</guid>
		<description><![CDATA[My Dilema Okay. I&#8217;ve worked on making a WordPress plugin once. It&#8217;s pretty easy to make a plugin which replaces a tag such as [another-plugin-tag parameter="value"] with some sort of other HTML code. For instance it&#8217;s pretty straight forward to replace [iframe http://www.google.com/ 800 600] with an iframe tag. Something I&#8217;ve found difficult to find...]]></description>
			<content:encoded><![CDATA[<h3>My Dilema</h3>
<p>Okay. I&#8217;ve worked on making a WordPress plugin once. It&#8217;s pretty easy to make a plugin which replaces a tag such as [another-plugin-tag parameter="value"] with some sort of other HTML code. For instance it&#8217;s pretty straight forward to replace [iframe http://www.google.com/ 800 600] with an iframe tag.</p>
<p>Something I&#8217;ve found difficult to find however is how you can create custom pages as soon as the plugin is activated, which are accessible using a permalink such as http://www.wordpress-site.com/myplugin/search/ which can submit a form to another URL such as http://www.wordpress-site.com/myplugin/results/ and then provide the results with a URL such as http://www.wordpress-site.com/myplugin/results/id/3/ or anything else pretty like that.</p>
<p>And I&#8217;m not talking about searching for posts or pages or anything. I&#8217;m talking about extending WordPress to have functionality which is not blog related, while still being a plugin.</p>
<p>I installed the &#8216;Contact Form 7&#8242; plugin to see how it submitted the form, and then I realized it uses Ajax. Great. I don&#8217;t want Ajax.</p>
<h3>A Hint of a Solution</h3>
<p>I searched online looking for something to explain this, because certainly someone else must have been scratching their head like I have. No guides seemed to explain this to me. I&#8217;d search for &#8216;WordPress plugin permalinks&#8217; and I&#8217;d only find plugins that deal with permalinks somehow (not what I was looking for).</p>
<p>And I was ignoring all the documentation on hooks and filters, because I don&#8217;t want to filter normal blog content, or hook to some blog content. But I was mistaken. I do want to hook a function to something. It turns out that WordPress has a number of actions which it goes through when loading a normal page, available by name in the <a href="http://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_a_Typical_Request">Plugin API Action Reference page</a>.</p>
<p>At some point of the page loading the permalink style URL, which is basically made possible by a mod_rewrite rule which says that any address is processed by index.php. The WordPress system determines if the URL relates to a page or post or something, or otherwise provides a 404 style error. Okay, so if I can somehow tell WordPress &#8211; &#8220;Yes! There is a /myplugin/ page&#8221;, or &#8220;Yes! There is a /myplugin/results/&#8221; page, then I&#8217;ll have one step of my solution finished.</p>
<p>After further researching I found that there is an article on how <a href="http://codex.wordpress.org/Query_Overview">WordPress processes a request</a>, and it even mentions GET and POST submissions. This was also obviously hard because &#8216;post&#8217; is the term used to refer to the blog post records, so a search on Google for &#8216;WordPress post request&#8217; didn&#8217;t return something relevant.</p>
<h3>To Be Continued</h3>
<p>I&#8217;m going to continue to investigate how to build the type of plugin which provides custom URL&#8217;s, without requiring the existence of pages for these URLs, and also somehow block the creation of pages which use the permalink structure used by the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redconfetti.com/2010/06/wordpress-plugin-custom-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

