<?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>gototake blog &#187; WordPress</title>
	<atom:link href="https://blog.gototake.com/?cat=4&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>https://blog.gototake.com</link>
	<description>自分用メモ</description>
	<lastBuildDate>Mon, 21 Nov 2016 12:04:51 +0000</lastBuildDate>
	<language>ja</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.1</generator>
	<item>
		<title>WordPress プラグインをつくる</title>
		<link>https://blog.gototake.com/?p=28</link>
		<comments>https://blog.gototake.com/?p=28#comments</comments>
		<pubDate>Mon, 31 Mar 2014 11:49:48 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.gototake.com/?p=28</guid>
		<description><![CDATA[まずはじめにコメントで設定 1 2 3 4 5 6 7 8 9 /* Plugin Name: Member  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>まずはじめにコメントで設定</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="coMULTI">/*</span>
<span class="coMULTI">Plugin Name: Member Only</span>
<span class="coMULTI">Plugin URI: なし</span>
<span class="coMULTI">Description: ログインしているユーザー以外には隠す</span>
<span class="coMULTI">Version: 1.0</span>
<span class="coMULTI">Author: XXXXX</span>
<span class="coMULTI">Author URI: http://www.XXXXXX.co.jp</span>
<span class="coMULTI">License: GPL2</span>
<span class="coMULTI">*/</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">/*
Plugin Name: Member Only
Plugin URI: なし
Description: ログインしているユーザー以外には隠す
Version: 1.0
Author: XXXXX
Author URI: http://www.XXXXXX.co.jp
License: GPL2
*/</pre>
</div>
</div>
<p>次に処理<br />
適当にfunctionをつくるって、割り込みたい処理のところに追加する。<br />
下記は、ポストの内容を一部置換して表示する場合</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">function</span> memberOnly<span class="br0">&#40;</span><span class="re0">$content</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>is_user_logged_in<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$content</span><span class="sy0">;</span>
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">preg_replace</span><span class="br0">&#40;</span><span class="st_h">'/\[memberOnly\].*?\[\/memberOnly\]/s'</span><span class="sy0">,</span><span class="st_h">''</span><span class="sy0">,</span><span class="re0">$content</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; <span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span>
add_filter<span class="br0">&#40;</span> <span class="st_h">'the_content'</span><span class="sy0">,</span> <span class="st_h">'memberOnly'</span> <span class="br0">&#41;</span><span class="sy0">;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">function memberOnly($content){
	if(is_user_logged_in()){
		return $content;
	}else{
		return preg_replace('/\[memberOnly\].*?\[\/memberOnly\]/s','',$content);
	}

}
add_filter( 'the_content', 'memberOnly' );</pre>
</div>
</div>
<p>/wp-content/plugins/<br />
に、ディレクトリをつくって、PHPファイルを置く。<br />
管理画面のプラグインのところから有効化で、割り込みが実行されるようにる。</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gototake.com/?feed=rss2&#038;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress複数投稿。</title>
		<link>https://blog.gototake.com/?p=77</link>
		<comments>https://blog.gototake.com/?p=77#comments</comments>
		<pubDate>Sat, 21 Nov 2009 19:15:00 +0000</pubDate>
		<dc:creator><![CDATA[mail001]]></dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.gototake.com/?p=77</guid>
		<description><![CDATA[WordPressで複数サイトの投稿を研究するが、いい方法がない。 仕方ないので、基本をメール投稿にしてそれぞ [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>WordPressで複数サイトの投稿を研究するが、いい方法がない。<br />
仕方ないので、基本をメール投稿にしてそれぞれのアドレスに投稿することにする。<br />
メールアドレスを辞書登録するなどして、うまくやろう。</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gototake.com/?feed=rss2&#038;p=77</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
