<?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>henkude &#187; editor</title>
	<atom:link href="http://henkude.com/blog/tag/editor/feed/" rel="self" type="application/rss+xml" />
	<link>http://henkude.com</link>
	<description>hen - very, ku - cool, de - 的</description>
	<lastBuildDate>Fri, 21 May 2010 14:41:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>如何在 BuddyPress 中启用 WP 原生的 theme editor</title>
		<link>http://henkude.com/blog/2009/11/17/%e5%a6%82%e4%bd%95%e5%9c%a8-buddypress-%e4%b8%ad%e5%90%af%e7%94%a8-wp-%e5%8e%9f%e7%94%9f%e7%9a%84-theme-editor/</link>
		<comments>http://henkude.com/blog/2009/11/17/%e5%a6%82%e4%bd%95%e5%9c%a8-buddypress-%e4%b8%ad%e5%90%af%e7%94%a8-wp-%e5%8e%9f%e7%94%9f%e7%9a%84-theme-editor/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 13:19:28 +0000</pubDate>
		<dc:creator>Kude Hen</dc:creator>
				<category><![CDATA[BuddyPress]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://henkude.com/?p=71</guid>
		<description><![CDATA[由于 BuddyPress 是基于 WPMU，因此后台和 WPMU 一样隐藏并禁用了 WP 原生的 theme editor，如果想在 BuddyPress 里使用 WP 原生的 theme editor，只要遵循以下步骤 (基于 BuddyPress 1.1.2/WPMU 2.8.5.2): 注释掉 /wp-admin/includes/mu.php 第556行: 1unset&#40; $submenu&#91;'themes.php'&#93;&#91;10&#93; &#41;; // always remove the themes editor 替换成 1//unset( $submenu['themes.php'][10] ); // always remove the themes editor 仍然在这个文件中，第1128行: 1if &#40; strpos&#40; $_SERVER&#91;'PHP_SELF'&#93;, $page &#41; &#41; &#123; 替换成 1if &#40; strpos&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>由于 BuddyPress 是基于 WPMU，因此后台和 WPMU 一样隐藏并禁用了 WP 原生的 theme editor，如果想在 BuddyPress 里使用 WP 原生的 theme editor，只要遵循以下步骤 (基于 BuddyPress 1.1.2/WPMU 2.8.5.2):</p>
<ol>
<li>注释掉 /wp-admin/includes/mu.php 第556行:
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'themes.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the themes editor</span></div></td></tr></tbody></table></div>
<p>替换成</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//unset( $submenu['themes.php'][10] ); // always remove the themes editor</span></div></td></tr></tbody></table></div>
</li>
<li>仍然在这个文件中，第1128行:
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/strpos"><span style="color: #990000;">strpos</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></td></tr></tbody></table></div>
<p>替换成</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/strpos"><span style="color: #990000;">strpos</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_site_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></td></tr></tbody></table></div>
</li>
</ol>
<p>这样可以确保只有在站点管理员 (Site Admin) 的后台界面才显示并激活原生的 theme editor。</p>
<p>另外，如果同时注释掉第555行:</p>
<ul>
<li>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the plugin editor</span></div></td></tr></tbody></table></div>
<p>替换成</p>
<div class="codecolorer-container php default" style="border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//unset( $submenu['plugins.php'][15] ); // always remove the plugin editor</span></div></td></tr></tbody></table></div>
</li>
</ul>
<p>那么可以同时激活原生的 plugin editor, ooops  <img src='http://henkude.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>参考: <a href="http://mu.wordpress.org/forums/topic/13318" target="_blank">http://mu.wordpress.org/forums/topic/13318</a></p>
<p><span style="color: #ff0000"><strong>Update:</strong></span> 以上代码位置在 BuddyPress 1.1.2/WPMU 2.8.6 没有变动。</p>
<div class="shr-publisher-71"></div>]]></content:encoded>
			<wfw:commentRss>http://henkude.com/blog/2009/11/17/%e5%a6%82%e4%bd%95%e5%9c%a8-buddypress-%e4%b8%ad%e5%90%af%e7%94%a8-wp-%e5%8e%9f%e7%94%9f%e7%9a%84-theme-editor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

