Fix notices when the Recent_Comments widget has no settings

git-svn-id: https://develop.svn.wordpress.org/trunk@11228 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2009-05-07 06:57:28 +00:00
parent fa31602215
commit a9fc3bac09
1 changed files with 2 additions and 3 deletions

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:'); ?>