Great points, Justin -<br><br>Good reminders for those familiar with writing "current" plugins; and very valuable for those that are not writing them, yet. (*grin*)<br><br><br>Cais.<br><br><div class="gmail_quote">
On Sat, Apr 30, 2011 at 12:51 PM, Justin Tadlock <span dir="ltr"><<a href="mailto:justin@justintadlock.com">justin@justintadlock.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff">
Yes, everyone should definitely be doing this. I have a few notes
for this too.<br>
<br>
------<br>
<br>
Widgets should be registered using the register_widget() function
like so:<br>
<br>
register_widget( 'Theme_Widget_Class_Name' );<br>
<br>
------<br>
<br>
Widgets should be coded by extending the WP_Widget class. So, the
first line of the widget code should be something like:<br>
<br>
class Theme_Widget_Class_Name extends WP_Widget {<br>
<br>
------<br>
<br>
For validating/sanitizing on input, you should look in the
"update()" method, which would begin like so:<br>
<br>
function update( $new_instance, $old_instance ) {<br>
<br>
------<br>
<br>
For escaping on output, you should look in the "form()" method,
which would begin like so:<br>
<br>
function form( $instance ) {<br>
<br>
------<br>
<br>
You should also make sure that "$before_widget" and "$after_widget"
are used for outputting the sidebar's HTML within the "widget()"
method. And, make sure widget titles look something like this on
display:<br>
<br>
if ( !empty( $instance['title'] ) )<br>
echo $before_title . apply_filters( 'widget_title',
$instance['title'], $instance, $this->id_base ) . $after_title;<div><div></div><div class="h5"><br>
<br>
<br>
On 4/29/2011 11:12 AM, Chip Bennett wrote:
</div></div><blockquote type="cite"><div><div></div><div class="h5">Good morning, Reviewers!
<div><br>
</div>
<div>Just a quick note: when reviewing Themes that include custom
Widgets, treat such Widgets as if they are Theme Settings. That
is, primarily, ensure that any user input is properly
validated/sanitized on input, and escaped upon output.</div>
<div><br>
</div>
<div>This is something that most of us (including me) may not have
been explicitly looking at...</div>
<div><br>
</div>
<div>Chip</div>
</div></div><pre><fieldset></fieldset>
_______________________________________________
theme-reviewers mailing list
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a>
</pre>
</blockquote>
</div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>