<?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>Calce &#187; notes</title>
	<atom:link href="http://calce.net/tag/notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://calce.net</link>
	<description>Remodelling in process</description>
	<lastBuildDate>Fri, 06 May 2011 20:49:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Make wp_localize_script() work properly</title>
		<link>http://calce.net/wp-notes/make-wp_localize_script-work-properly/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-wp_localize_script-work-properly</link>
		<comments>http://calce.net/wp-notes/make-wp_localize_script-work-properly/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 20:40:14 +0000</pubDate>
		<dc:creator>Khanh Cao</dc:creator>
				<category><![CDATA[WP Notes]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[localize]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://calce.net/?p=982</guid>
		<description><![CDATA[wp_localize_script($handle, $object_name, $l10n); For example: $myvars = array('value' =&#62; 'one'); wp_localize_script('my-handle', 'myVars', $myvars); The above code won't do anything unless you enqueue a script with the same handle before it, like this: wp_enqueue_script('my-handle', 'path-to-js-file.js'); $myvars = array('value' =&#62; 'one'); wp_localize_script('my-handle', 'myVars', $myvars); This code will be inserted into your page: /* &#60;![CDATA[ */ var myVars [...]]]></description>
			<content:encoded><![CDATA[<p><code>wp_localize_script($handle, $object_name, $l10n);</code><br />
For example:<br />
<code>$myvars = array('value' =&gt; 'one');<br />
wp_localize_script('my-handle', 'myVars', $myvars);</code></p>
<p>The above code won't do anything unless you enqueue a script with the same handle before it, like this:</p>
<p><code>wp_enqueue_script('my-handle', 'path-to-js-file.js');<br />
$myvars = array('value' =&gt; 'one');<br />
wp_localize_script('my-handle', 'myVars', $myvars);</code></p>
<p>This code will be inserted into your page:</p>
<p><code>/* &lt;![CDATA[ */<br />
var myVars = {<br />
value: "one"<br />
};<br />
/* ]]&gt; */</code></p>
<p>Then you can reference myVars in your script later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://calce.net/wp-notes/make-wp_localize_script-work-properly/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>wp_list_comments() will append an end tag to your comment</title>
		<link>http://calce.net/wp-notes/wp_list_comments-will-append-an-end-tag-to-your-comment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wp_list_comments-will-append-an-end-tag-to-your-comment</link>
		<comments>http://calce.net/wp-notes/wp_list_comments-will-append-an-end-tag-to-your-comment/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 21:27:46 +0000</pubDate>
		<dc:creator>Khanh Cao</dc:creator>
				<category><![CDATA[WP Notes]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://calce.net/?p=937</guid>
		<description><![CDATA[On every call to your call back from wp_list_comments(), there will be an end tag appended, this tag can be either &#60;/li&#62; or &#60;/div&#62; depending on your style parameter. Therefore, in your call back function, don't put your own end tag there. For example, my call back function was like this: function custom_comments($comment, $args, $depth) [...]]]></description>
			<content:encoded><![CDATA[<p class='cap'>On every call to your call back from wp_list_comments(), there will be an end tag appended, this tag can be either &#60;/li&#62; or &#60;/div&#62; depending on your <em>style</em> parameter. Therefore, in your call back function, don't put your own end tag there. For example, my call back function was like this:<!-- more -->
</p>
<pre>
function custom_comments($comment, $args, $depth) {
  ?&#62;
  &#60;li id="comment-&#60;?php comment_ID() ?&#62;" &#60;?php comment_class(); ?&#62;&#62;
  ...
  &#60;/li&#62;
  &#60;?php
}
</pre>
<p>Perfectly fine, except that there will be another &#60;/li&#62; appears when the page shows, making html errors and potentially may break your page's layout. The obvious solution is to remove the &#60;/li&#62; tag in my function.</p>
]]></content:encoded>
			<wfw:commentRss>http://calce.net/wp-notes/wp_list_comments-will-append-an-end-tag-to-your-comment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

