<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>oganosin blog&#187; 携帯</title>
	<atom:link href="http://www.oganosin.net/blog/tag/%e6%90%ba%e5%b8%af/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oganosin.net/blog</link>
	<description>oganosin weblog</description>
	<lastBuildDate>Wed, 21 Jul 2010 03:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.oganosin.net/blog/tag/%e6%90%ba%e5%b8%af/feed/" />
		<item>
		<title>初めてのwordpress plugin その1</title>
		<link>http://www.oganosin.net/blog/programming/2009050100/</link>
		<comments>http://www.oganosin.net/blog/programming/2009050100/#comments</comments>
		<pubDate>Fri, 01 May 2009 00:49:53 +0000</pubDate>
		<dc:creator>oganosin</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[プログラム]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[携帯]]></category>

		<guid isPermaLink="false">http://www.oganosin.net/blog/?p=61</guid>
		<description><![CDATA[勉強がてらwordpressのpluginを作ってみた。
どうやらwordpressのpluginはadd_filterで出力に対してフィルターをかけることが
一つの定番のようです。当初はDBなんかは使わず、出力に対して [...]]]></description>
			<content:encoded><![CDATA[<p>勉強がてらwordpressのpluginを作ってみた。<br />
どうやらwordpressのpluginはadd_filterで出力に対してフィルターをかけることが<br />
一つの定番のようです。当初はDBなんかは使わず、出力に対してフィルターをかけることがメインかと思う。</p>
<p>参考にしたのは<br />
<a href="http://zone.maple4ever.net/blog/archives/440/">http://zone.maple4ever.net/blog/archives/440/</a><br />
このサイト。<br />
まずは初めてのプラグインということで、Ktai_styleにteltoリンクを追加するものを<br />
作成してみた。ソースは以下の通り。<br />
例えば　<a href="tel:0120-000-000">0120-000-000</a><br />
なんかにリンクがつくはず。</p>
<p><code></p>
<pre>
&lt;?php
/*
Plugin Name: Add mobile links
Plugin URI: http://www.oganosin.net/
Description: add telto link to the entry
Author: oganosin
Version: 1.0
Author URI: http://www.oganosin.net
*/

add_filter('the_content', 'addteltolinks');

function addteltolinks($body) {
        if(!defined ('KS_VERSION')){
            return $body;
        }
        $body = preg_replace('/(\d{2,4}\-\d{2,4}\-\d{2,4})/',
                '&lt;a href="tel:\\1"&gt;\\1&lt;/a&gt;',
                $body);
        return $body;
}
?&gt;
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oganosin.net/blog/programming/2009050100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.oganosin.net/blog/programming/2009050100/" />
	</item>
	</channel>
</rss>
