Fix notices when the Recent_Comments widget has no settings

git-svn-id: http://svn.automattic.com/wordpress/trunk@11228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-05-07 06:57:28 +00:00
parent 51ff5245cf
commit 99c157dbaf

View File

@ -659,9 +659,8 @@ class WP_Widget_Recent_Comments extends WP_Widget {
}
function form( $instance ) {
$title = esc_attr($instance['title']);
if ( !$number = (int) $instance['number'] )
$number = 5;
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
$number = isset($instance['number']) ? absint($instance['number']) : 5;
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>">
<?php _e('Title:'); ?>