<?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>Web Threads &#187; plugins</title>
	<atom:link href="http://www.web-threads.com/tag/plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-threads.com</link>
	<description>Websites for Business and Online Communities</description>
	<lastBuildDate>Tue, 10 Aug 2010 21:48:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Plugin Exec-PHP Hack &#8211; Disable For Post</title>
		<link>http://www.web-threads.com/2010/01/wordpress-plugin-exec-php-hack-disable-for-post/</link>
		<comments>http://www.web-threads.com/2010/01/wordpress-plugin-exec-php-hack-disable-for-post/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:54:05 +0000</pubDate>
		<dc:creator>Web Threads</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.web-threads.com/?p=343</guid>
		<description><![CDATA[If you&#8217;re running the Exec-PHP plugin in Wordpress and struggling with posting your php code blocks without it being executed, I&#8217;ve made a quick hack to disable this plugin per post by adding a custom field. You just have to remember not to upgrade automatically or you&#8217;ll lose the changes. With a few lines of code and a Custom field in on your post entry page, you can disable Exec-PHP and it will skip this content. Note it will still run on other elements, just not the content.

In file plugins/exec-php/includes/runtime.php find the block that starts at line 52:

	function filter_user_content&#40;$content&#41;
	&#123;
		global $post;

Add after it:

		// check if this post has disabled exec-php in custom fields
		$custom_fields = get_post_custom&#40;&#41;; 
		$php_disable_this_post = $custom_fields&#91;'disablephp_exec'&#93;;
		$phpexecdisable= $php_disable_this_post&#91;0&#93;;
		if &#40;$phpexecdisable =='1'&#41;
			return $content;

Add the Custom Field to your post, &#8216;disablephp_exec&#8217; and give it a value of 1. 
Upload your new runtime.php file and you&#8217;re off.
This is a great plugin, very useful, but ...]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running the Exec-PHP plugin in Wordpress and struggling with posting your php code blocks without it being executed, I&#8217;ve made a quick hack to disable this plugin per post by adding a custom field. <em>You just have to remember not to upgrade automatically or you&#8217;ll lose the changes.</em> With a few lines of code and a Custom field in on your post entry page, you can disable Exec-PHP and it will skip this content. Note it will still run on other elements, just not the content.</p>
<p><span id="more-343"></span><br />
In file plugins/exec-php/includes/runtime.php find the block that starts at line 52:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">function</span> filter_user_content<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span></pre></div></div>

<p>Add after it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">// check if this post has disabled exec-php in custom fields</span>
		<span style="color: #000088;">$custom_fields</span> <span style="color: #339933;">=</span> get_post_custom<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
		<span style="color: #000088;">$php_disable_this_post</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$custom_fields</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'disablephp_exec'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$phpexecdisable</span><span style="color: #339933;">=</span> <span style="color: #000088;">$php_disable_this_post</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$phpexecdisable</span> <span style="color: #339933;">==</span><span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span></pre></div></div>

<p>Add the Custom Field to your post, &#8216;disablephp_exec&#8217; and give it a value of 1. </p>
<p>Upload your new runtime.php file and you&#8217;re off.</p>
<p>This is a great plugin, very useful, but I wish it used code tags instead of standard php tags.</p>
<p><a href="http://wordpress.org/extend/plugins/exec-php/">Exec-PHP Plugin on Wordpress</a><br />
<a href="http://bluesome.net/post/2005/08/18/50/">Exec-PHP Homepage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.web-threads.com/2010/01/wordpress-plugin-exec-php-hack-disable-for-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

