<?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>ChillyBin Web Design &#38; Consultancy, Singapore &#187; Replace</title>
	<atom:link href="http://www.chillybin.com.sg/tag/replace/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chillybin.com.sg</link>
	<description>Keepin&#039; it fresh!</description>
	<lastBuildDate>Fri, 25 Nov 2011 06:39:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to stop WordPress removing line breaks</title>
		<link>http://www.chillybin.com.sg/blog/how-to-stop-wordpress-removing-line-breaks/</link>
		<comments>http://www.chillybin.com.sg/blog/how-to-stop-wordpress-removing-line-breaks/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 07:03:32 +0000</pubDate>
		<dc:creator>Shaan Nicol</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[E]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Replace]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wpautop]]></category>

		<guid isPermaLink="false">http://www.chillybin.com.sg/?p=399</guid>
		<description><![CDATA[We&#8217;ve all had these problems working with WordPress as designers where you are trying to format an article or something for a client and have everything lined up perfectly, publish the article, only to find out that WordPress has removed all your manual line-breaks! Fortunately there is a pretty simple fix, I had to edit [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all had these problems working with WordPress as designers where you are trying to format an article or something for a client and have everything lined up perfectly, publish the article, only to find out that WordPress has removed all your manual line-breaks!</p>
<p>Fortunately there is a pretty simple fix, I had to edit <strong>formatting.php</strong> in order to keep wpautop() from removing my deliberate breaks. I commented out the following line which replaces two occurrences of BR separated only by whitespace with two newlines:</p>
<p><code>//$pee = preg_replace('|&lt;br /&gt;\s*&lt;br /&gt;|', "\n\n", $pee);</code></p>
<p>Then, I commented out this line found towards the end of the function and replaced it with a version that exempts BRs from being removed:</p>
<p>Commented out:<br />
<code>//$pee = preg_replace('!&lt;br /&gt;(\s*&lt;/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^&gt;]*&gt;)!', '$1', $pee);</code></p>
<p>Replaced with:<br />
<code>$pee = preg_replace('!(\s*&lt;/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^&gt;]*&gt;)!', '$1', $pee);</code></p>
<p>This keeps wordpress from stripping the breaks, but it does not keep Tiny MCE from doing it if you go to visual mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chillybin.com.sg/blog/how-to-stop-wordpress-removing-line-breaks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find &amp; Replace in MySQL</title>
		<link>http://www.chillybin.com.sg/blog/find-and-replace-in-mysql/</link>
		<comments>http://www.chillybin.com.sg/blog/find-and-replace-in-mysql/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 09:54:00 +0000</pubDate>
		<dc:creator>Shaan Nicol</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[E]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Replace]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.chillybin.com.sg/?p=340</guid>
		<description><![CDATA[Somewhere between the backing-up and restoration of a clients MySQL WordPress database we picked up some strange characters. Rather than having to go through by hand to edit them out, we used a nice SQL snippet to do a full-database search and replace. update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]'); So in this case, to get [...]]]></description>
			<content:encoded><![CDATA[<p>Somewhere between the backing-up and restoration of a clients MySQL WordPress database we picked up some strange characters. Rather than having to go through by hand to edit them out, we used a nice SQL snippet to do a full-database search and replace.</p>
<p><code>update [table_name] set [field_name] =<br />
replace([field_name],'[string_to_find]','[string_to_replace]');</code></p>
<p>So in this case, to get rid of these weird “Ã‚Â” characters, we ran the statement</p>
<p><code>update wp_posts set post_content = replace(post_content,'Ã‚Â','');</code></p>
<p>Worked perfectly for us, it should for you as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chillybin.com.sg/blog/find-and-replace-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 1/16 queries in 0.028 seconds using disk: basic
Object Caching 549/574 objects using disk: basic
Content Delivery Network via Amazon Web Services: CloudFront: doz823ygeuhxp.cloudfront.net

Served from: www.chillybin.com.sg @ 2012-02-06 04:53:08 -->
