<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: The complete guide to creating widgets in WordPress 2.8</title>
	<atom:link href="http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28/feed" rel="self" type="application/rss+xml" />
	<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28</link>
	<description>Life, Blogging, and WordPress</description>
	<lastBuildDate>Fri, 10 Feb 2012 12:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: WordPress ile ilgili takip edilesi 10 muhteşem blog &#124; Blog Wolkanca</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-550868</link>
		<dc:creator>WordPress ile ilgili takip edilesi 10 muhteşem blog &#124; Blog Wolkanca</dc:creator>
		<pubDate>Wed, 04 Jan 2012 18:01:50 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-550868</guid>
		<description>[...] The complete guide to creating widgets in WordPress 2.8 [...]</description>
		<content:encoded><![CDATA[<p>[...] The complete guide to creating widgets in WordPress 2.8 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Tadlock</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-522267</link>
		<dc:creator>Justin Tadlock</dc:creator>
		<pubDate>Sat, 17 Dec 2011 22:56:43 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-522267</guid>
		<description>If you follow this guide, you can use the widget as many times as you want to.</description>
		<content:encoded><![CDATA[<p>If you follow this guide, you can use the widget as many times as you want to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edson</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-522201</link>
		<dc:creator>Edson</dc:creator>
		<pubDate>Sat, 17 Dec 2011 21:20:03 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-522201</guid>
		<description>I have developed a widget but I want to use it more than once. Is there a parameter or something that tells WP how to keep it in widgets panel while I place it on sidebar as many times as I want? Tks!</description>
		<content:encoded><![CDATA[<p>I have developed a widget but I want to use it more than once. Is there a parameter or something that tells WP how to keep it in widgets panel while I place it on sidebar as many times as I want? Tks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wordpress Widgets &#171; netzdings.de</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-507087</link>
		<dc:creator>Wordpress Widgets &#171; netzdings.de</dc:creator>
		<pubDate>Mon, 05 Dec 2011 22:46:33 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-507087</guid>
		<description>[...] dann nach jedem Update wieder anpassen zu müssen. Mit ein bisschen Google findet man auch einiges hilfreiches zu dem [...]</description>
		<content:encoded><![CDATA[<p>[...] dann nach jedem Update wieder anpassen zu müssen. Mit ein bisschen Google findet man auch einiges hilfreiches zu dem [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanam Maharjan</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-501680</link>
		<dc:creator>Sanam Maharjan</dc:creator>
		<pubDate>Fri, 02 Dec 2011 06:54:42 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-501680</guid>
		<description>Hello Brent,
      Any luck with this multiple checkbox issue. I also have tried many way around but could not get hold of it. Would be very grateful for any leads from anybody. 

Thanks you :)</description>
		<content:encoded><![CDATA[<p>Hello Brent,<br />
      Any luck with this multiple checkbox issue. I also have tried many way around but could not get hold of it. Would be very grateful for any leads from anybody. </p>
<p>Thanks you <img src='http://justintadlock.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-481978</link>
		<dc:creator>James</dc:creator>
		<pubDate>Wed, 16 Nov 2011 12:49:02 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-481978</guid>
		<description>This was perfect - I can&#039;t believe how wasy it is to build a custom widget. Thanks.</description>
		<content:encoded><![CDATA[<p>This was perfect &#8211; I can&#8217;t believe how wasy it is to build a custom widget. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brent</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-481258</link>
		<dc:creator>brent</dc:creator>
		<pubDate>Wed, 16 Nov 2011 01:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-481258</guid>
		<description>hmmm...

my attempt to sneak in tags didn&#039;t work</description>
		<content:encoded><![CDATA[<p>hmmm&#8230;</p>
<p>my attempt to sneak in tags didn&#8217;t work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brent</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-481256</link>
		<dc:creator>brent</dc:creator>
		<pubDate>Wed, 16 Nov 2011 01:12:45 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-481256</guid>
		<description>Hey Justin,

I just bought the book you wrote with Brad and Ohz, and so far it is quite helpful, but the one thing that is not covered with regards to widget creation, is how to utilize multiple checkboxes that are dynamically created.

Basically I need to dynamically create a list of checkboxes, that will then be used to toggle the display of items on the frontend of the site.

I do not know how many items, or what any of their names will be.

Here&#039;s an example from my own code I am trying to get working:  
(I&#039;ll leave out the bits that don&#039;t apply - also please note that  are supposed to represent the open and close p-h-p tags)

&lt;pre&gt;&lt;code&gt;function form( $instance ) {
		
	$instance = wp_parse_args( (array) $instance, $defaults );

	echo &#039;&#039;.__(&#039;Display the following:&#039;, &#039;my_plugin&#039;);
	echo &#039;&#039;;
	
	foreach ( $items as $item_type =&gt; $item ) {

		$label = isset( $item[&#039;title&#039;] ) ? $item[&#039;title&#039;] : $item_type ;

		$chk = &#039;item_display_&#039; . $item_type;
	
		&lt;input type=&quot;checkbox&quot; 
			name=&quot; echo $this-&gt;get_field_name( $chk );&quot; 
			value=&quot; echo $instance[$chk];&quot; 
			 echo checked( $instance[$chk], TRUE );/&gt;

		 echo __($label, &#039;my_plugin&#039;);?&gt;
	}

	echo &#039;&#039;;

}

function update( $new_instance, $old_instance ) {

	$instance = $old_instance;
	$instance[&#039;title&#039;] = strip_tags( $new_instance[&#039;title&#039;] );
	
	foreach ( items as $item_type =&gt; $item ) {
	
		$chk = &#039;item_display_&#039; . $item_type;
		$instance[$chk] = strip_tags( $new_instance[$chk] );
		
	}
			
	return $instance;
}

function widget( $args, $instance ) {
		
	extract($args);

	foreach ( items as $item_type =&gt; $item ) {
	
		$chk = &#039;item_display_&#039; . $item_type;

		if ( $instance[$chk] == TRUE ) {
		// display item
		}
	}
}&lt;/code&gt;&lt;/pre&gt;

the last part doesn&#039;t even matter at this point because I am unable to even get the widget to save it&#039;s values.

I&#039;m only about half way through your book, but am pretty certain I&#039;m not going to find the answer since the index only lists one reference to checked() on page 70.

So how? how? HOW? do you dynamically create checkboxes in a WP Widget?

Thank you in advance for your time, effort and talent.</description>
		<content:encoded><![CDATA[<p>Hey Justin,</p>
<p>I just bought the book you wrote with Brad and Ohz, and so far it is quite helpful, but the one thing that is not covered with regards to widget creation, is how to utilize multiple checkboxes that are dynamically created.</p>
<p>Basically I need to dynamically create a list of checkboxes, that will then be used to toggle the display of items on the frontend of the site.</p>
<p>I do not know how many items, or what any of their names will be.</p>
<p>Here&#8217;s an example from my own code I am trying to get working:<br />
(I&#8217;ll leave out the bits that don&#8217;t apply &#8211; also please note that  are supposed to represent the open and close p-h-p tags)</p>
<pre><code>function form( $instance ) {

	$instance = wp_parse_args( (array) $instance, $defaults );

	echo ''.__('Display the following:', 'my_plugin');
	echo '';

	foreach ( $items as $item_type =&gt; $item ) {

		$label = isset( $item['title'] ) ? $item['title'] : $item_type ;

		$chk = 'item_display_' . $item_type;

		&lt;input type=&quot;checkbox&quot;
			name=&quot; echo $this-&gt;get_field_name( $chk );"
			value=" echo $instance[$chk];"
			 echo checked( $instance[$chk], TRUE );/&gt;

		 echo __($label, 'my_plugin');?&gt;
	}

	echo '';

}

function update( $new_instance, $old_instance ) {

	$instance = $old_instance;
	$instance['title'] = strip_tags( $new_instance['title'] );

	foreach ( items as $item_type =&gt; $item ) {

		$chk = 'item_display_' . $item_type;
		$instance[$chk] = strip_tags( $new_instance[$chk] );

	}

	return $instance;
}

function widget( $args, $instance ) {

	extract($args);

	foreach ( items as $item_type =&gt; $item ) {

		$chk = 'item_display_' . $item_type;

		if ( $instance[$chk] == TRUE ) {
		// display item
		}
	}
}</code></pre>
<p>the last part doesn&#8217;t even matter at this point because I am unable to even get the widget to save it&#8217;s values.</p>
<p>I&#8217;m only about half way through your book, but am pretty certain I&#8217;m not going to find the answer since the index only lists one reference to checked() on page 70.</p>
<p>So how? how? HOW? do you dynamically create checkboxes in a WP Widget?</p>
<p>Thank you in advance for your time, effort and talent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-480367</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 15 Nov 2011 10:34:13 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-480367</guid>
		<description>i was searching for the tutorial to get started with wordpress plugin development. My friend suggested me to have a look at yours. I haven&#039;t gone anywhere else and got satisfied with the result. Cheers!! Thanks for nice tut..</description>
		<content:encoded><![CDATA[<p>i was searching for the tutorial to get started with wordpress plugin development. My friend suggested me to have a look at yours. I haven&#8217;t gone anywhere else and got satisfied with the result. Cheers!! Thanks for nice tut..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adrian</title>
		<link>http://justintadlock.com/archives/2009/05/26/the-complete-guide-to-creating-widgets-in-wordpress-28#comment-475449</link>
		<dc:creator>adrian</dc:creator>
		<pubDate>Fri, 11 Nov 2011 00:36:22 +0000</pubDate>
		<guid isPermaLink="false">http://justintadlock.com/?p=1646#comment-475449</guid>
		<description>hey. nice tutorial. thanks for the time.

im having trouble calling a filter from a widget. is it possible. does it run too late. 

function widget( $args, $instance ) {
...
add_filter( &#039;the_content&#039;, &#039;filter_the_content&#039;);
..
}

//do whatever
function filter_the_content($content) {
      $bacon = &#039; bacon is good&#039;
      return $bacon . $content;
}

sorry for posting this here. but seems like you are the widget man</description>
		<content:encoded><![CDATA[<p>hey. nice tutorial. thanks for the time.</p>
<p>im having trouble calling a filter from a widget. is it possible. does it run too late. </p>
<p>function widget( $args, $instance ) {<br />
&#8230;<br />
add_filter( &#8216;the_content&#8217;, &#8216;filter_the_content&#8217;);<br />
..<br />
}</p>
<p>//do whatever<br />
function filter_the_content($content) {<br />
      $bacon = &#8216; bacon is good&#8217;<br />
      return $bacon . $content;<br />
}</p>
<p>sorry for posting this here. but seems like you are the widget man</p>
]]></content:encoded>
	</item>
</channel>
</rss>

