<?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>Open Script Solution&#187; Editor</title>
	<atom:link href="http://www.openscriptsolution.com/tag/editor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Make Link Tag in WordPress Post/Page Editor Become Open In New Tab/Window by Default</title>
		<link>http://www.openscriptsolution.com/2010/07/10/how-to-make-link-tag-in-wordpress-postpage-editor-become-open-in-new-tabwindow-by-default/</link>
		<comments>http://www.openscriptsolution.com/2010/07/10/how-to-make-link-tag-in-wordpress-postpage-editor-become-open-in-new-tabwindow-by-default/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:22:49 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Buka di jendela baru]]></category>
		<category><![CDATA[buka di tab baru]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Open in New Tab]]></category>
		<category><![CDATA[Open in New Window]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[target="_blank"]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1222</guid>
		<description><![CDATA[This following modification will change the javascript files that belong to WordPress core, in order to make the Link tag in WordPress post/page editor become open in new tab/window by default. As we know, by default in WordPress, this tag will open in the same window since there is no target=&#8221;_blank&#8221; property in the a [...]]]></description>
			<content:encoded><![CDATA[<p>This following modification will change the javascript files that belong to WordPress core, in order to make the Link tag in WordPress post/page editor become open in new tab/window by default. As we know, by default in WordPress, this tag will open in the same window since there is no <strong>target=&#8221;_blank&#8221;</strong> property in the <strong>a href</strong>, especially if you insert this tag by typing your post/page from HTML tab (not from Visual tab) on your WordPress&#8217; post/page editor. As this will change the core file of your WordPress, then you have to change the related files if you upgrade your WordPress core installation. So, please be kind, everyone! <span id="more-1222"></span></p>
<ol>
<li>
Open your <strong>/wp-includes/js/quicktags.js</strong> file, and find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">if(a){edButtons[c].tagStart='&lt;a href=&quot;'+a+'&quot;&gt;';</pre></div></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">if(a){edButtons[c].tagStart='&lt;a href=&quot;'+a+'&quot; target=&quot;_blank&quot;&gt;';</pre></div></div>

</li>
<li>
Open your <strong>/wp-includes/js/quicktags.dev.js</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>144
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	this<span style="color: #339933;">.</span>newWin <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>144
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">	this<span style="color: #339933;">.</span>newWin <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Modified by Masino Sinaga, July 10, 2010, in order to add target=&quot;_blank&quot; phrase while creating new link</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>216
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #000000; font-weight: bold;">var</span> newWin <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> tempStr<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>216
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #000000; font-weight: bold;">var</span> newWin <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span> tempStr<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Modified by Masino Sinaga, May 20, 2010, in order to add target=&quot;_blank&quot; phrase while creating new link</span></pre></td></tr></table></div>

<p>Find again this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>451
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">			<span style="color: #000000; font-weight: bold;">var</span> newWin <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> tempStr<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>451
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">			<span style="color: #000000; font-weight: bold;">var</span> newWin <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span> tempStr<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Modified by Masino Sinaga, May 20, 2010, in order to add target=&quot;_blank&quot; phrase while creating new link</span></pre></td></tr></table></div>

</li>
<li>
Clear your browser&#8217;s cache that you are currently using, afterwards close and re-open your browser, then try to login to your editor&#8217;s post/page via &#8220;HTML&#8221; tab in your WordPress, then try the Link tag. You should see that WordPress has automatically added the <strong>target=&#8221;_blank&#8221;</strong> phrase inside the Link <strong>a href</strong> tag.
</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F07%2F10%2Fhow-to-make-link-tag-in-wordpress-postpage-editor-become-open-in-new-tabwindow-by-default%2F&amp;title=How%20to%20Make%20Link%20Tag%20in%20WordPress%20Post%2FPage%20Editor%20Become%20Open%20In%20New%20Tab%2FWindow%20by%20Default" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/07/10/how-to-make-link-tag-in-wordpress-postpage-editor-become-open-in-new-tabwindow-by-default/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Implement Script Modifications to Overcome Three Bugs in WordPress 2.9</title>
		<link>http://www.openscriptsolution.com/2009/12/23/how-to-implement-script-modifications-to-overcome-three-bugs-in-wordpress-2-9/</link>
		<comments>http://www.openscriptsolution.com/2009/12/23/how-to-implement-script-modifications-to-overcome-three-bugs-in-wordpress-2-9/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 01:12:53 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[modification]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1069</guid>
		<description><![CDATA[Have you upgraded your own WordPress blog to version 2.9? What happened then? Yeah, many people complained about the schedule feature for the post did not work properly, as this is one of the advantage features in WordPress. I, myself, very often using this feature. After searching via Google, then I found a solution from [...]]]></description>
			<content:encoded><![CDATA[<p>Have you upgraded your own WordPress blog to version 2.9? What happened then? Yeah, many people complained about the schedule feature for the post did not work properly, as this is one of the advantage features in WordPress. I, myself, very often using this feature. After searching via Google, then I found a solution from this: <a href="http://www.semiologic.com/2009/12/21/wp-2-9-three-bugs-and-how-to-fix-them/">WP 2.9: three bugs, and how to fix them</a>. Driven by my curiosity, then I compared the three files that are the result of modifications to the original versions of that three files. Finally, I found which code should be changed. If you want to modify those three files, please do so by using the <strong>cPanel</strong> of your web hosting. Do not, I repeat: do not ever use the Editor features in the admin panel, since this Editor features looked like has the problem too in WordPress version 2.9. Be careful, as you will modify the WordPress core files itself! <span id="more-1069"></span></p>
<ol>
<li>
Open your <strong>/wp-includes/class-simplepie.php</strong>, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">// This is last, as behaviour of this varies with OS userland and PHP version</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iconv'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// If we can't do anything, just fail</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">// This is last, as behaviour of this varies with OS userland and PHP version</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iconv'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">iconv</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$input</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// allow crappy servers to at least convert UTF-8 to UTF-8</span>
		<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$input</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$output</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// If we can't do anything, just fail</span>
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/wp-includes/default-widgets.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>734
735
736
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$after_widget</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span>__destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
		<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>734
735
736
737
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$after_widget</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_wp_error<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span>__destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
		<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>
Open your <strong>/wp-includes/http.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">// CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers.  Have to use ceil since</span>
		<span style="color: #666666; font-style: italic;">// a value of 0 will allow an ulimited timeout.</span>
		<span style="color: #666666; font-style: italic;">// Use _MS if available.</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">defined</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'CURLOPT_TIMEOUT_MS'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$timeout_ms</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1000</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timeout'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_CONNECTTIMEOUT_MS<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout_ms</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT_MS<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout_ms</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$timeout</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timeout'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_CONNECTTIMEOUT<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1297
1298
1299
1300
1301
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">// CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers.  Have to use ceil since</span>
		<span style="color: #666666; font-style: italic;">// a value of 0 will allow an ulimited timeout.</span>
		<span style="color: #000088;">$timeout</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #990000;">ceil</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'timeout'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_CONNECTTIMEOUT<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #000088;">$timeout</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Good luck! <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F23%2Fhow-to-implement-script-modifications-to-overcome-three-bugs-in-wordpress-2-9%2F&amp;title=How%20to%20Implement%20Script%20Modifications%20to%20Overcome%20Three%20Bugs%20in%20WordPress%202.9" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/23/how-to-implement-script-modifications-to-overcome-three-bugs-in-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
