diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php
index e48cc01fe2..c010890f3b 100644
--- a/src/wp-includes/default-widgets.php
+++ b/src/wp-includes/default-widgets.php
@@ -19,7 +19,6 @@ class WP_Widget_Pages extends WP_Widget {
}
function widget( $args, $instance ) {
- extract( $args );
/**
* Filter the widget title.
@@ -54,16 +53,17 @@ class WP_Widget_Pages extends WP_Widget {
'exclude' => $exclude
) ) );
- if ( !empty( $out ) ) {
- echo $before_widget;
- if ( $title)
- echo $before_title . $title . $after_title;
+ if ( ! empty( $out ) ) {
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
?>
$before_title, 'title_after' => $after_title,
- 'category_before' => $before_widget, 'category_after' => $after_widget,
+ 'title_before' => $args['before_title'], 'title_after' => $args['after_title'],
+ 'category_before' => $before_widget, 'category_after' => $args['after_widget'],
'show_images' => $show_images, 'show_description' => $show_description,
'show_name' => $show_name, 'show_rating' => $show_rating,
'category' => $category, 'class' => 'linkcat widget',
@@ -229,19 +228,19 @@ class WP_Widget_Search extends WP_Widget {
}
function widget( $args, $instance ) {
- extract($args);
/** This filter is documented in wp-includes/default-widgets.php */
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
// Use current theme search form if it exists
get_search_form();
- echo $after_widget;
+ echo $args['after_widget'];
}
function form( $instance ) {
@@ -274,16 +273,16 @@ class WP_Widget_Archives extends WP_Widget {
}
function widget( $args, $instance ) {
- extract($args);
$c = ! empty( $instance['count'] ) ? '1' : '0';
$d = ! empty( $instance['dropdown'] ) ? '1' : '0';
/** This filter is documented in wp-includes/default-widgets.php */
- $title = apply_filters( 'widget_title', empty($instance['title'] ) ? __( 'Archives' ) : $instance['title'], $instance, $this->id_base );
+ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives' ) : $instance['title'], $instance, $this->id_base );
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
if ( $d ) {
?>
@@ -330,7 +329,7 @@ class WP_Widget_Archives extends WP_Widget {
id_base );
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
?>
@@ -406,7 +405,7 @@ class WP_Widget_Meta extends WP_Widget {
?>
id_base );
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
echo '';
get_calendar();
echo '
';
- echo $after_widget;
+ echo $args['after_widget'];
}
function update( $new_instance, $old_instance ) {
@@ -483,7 +482,6 @@ class WP_Widget_Text extends WP_Widget {
}
function widget( $args, $instance ) {
- extract($args);
/** This filter is documented in wp-includes/default-widgets.php */
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
@@ -497,11 +495,13 @@ class WP_Widget_Text extends WP_Widget {
* @param WP_Widget $instance WP_Widget instance.
*/
$text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );
- echo $before_widget;
- if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
+ echo $args['before_widget'];
+ if ( ! empty( $title ) ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ } ?>
id_base );
@@ -552,9 +551,10 @@ class WP_Widget_Categories extends WP_Widget {
$h = ! empty( $instance['hierarchical'] ) ? '1' : '0';
$d = ! empty( $instance['dropdown'] ) ? '1' : '0';
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
$cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
@@ -605,7 +605,7 @@ class WP_Widget_Categories extends WP_Widget {
have_posts()) :
?>
-
-
+
+
have_posts() ) : $r->the_post(); ?>
-
@@ -721,7 +722,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
-
+
'publish'
) ) );
- $output .= $before_widget;
- if ( $title )
- $output .= $before_title . $title . $after_title;
+ $output .= $args['before_widget'];
+ if ( $title ) {
+ $output .= $args['before_title'] . $title . $args['after_title'];
+ }
$output .= '';
- $output .= $after_widget;
+ $output .= $args['after_widget'];
echo $output;
@@ -1220,7 +1221,6 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
}
function widget( $args, $instance ) {
- extract($args);
$current_taxonomy = $this->_get_current_taxonomy($instance);
if ( !empty($instance['title']) ) {
$title = $instance['title'];
@@ -1236,9 +1236,10 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
/** This filter is documented in wp-includes/default-widgets.php */
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
- echo $before_widget;
- if ( $title )
- echo $before_title . $title . $after_title;
+ echo $args['before_widget'];
+ if ( $title ) {
+ echo $args['before_title'] . $title . $args['after_title'];
+ }
echo '';
/**
@@ -1256,7 +1257,7 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
) ) );
echo "
\n";
- echo $after_widget;
+ echo $args['after_widget'];
}
function update( $new_instance, $old_instance ) {
@@ -1323,8 +1324,13 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
}
function update( $new_instance, $old_instance ) {
- $instance['title'] = strip_tags( stripslashes($new_instance['title']) );
- $instance['nav_menu'] = (int) $new_instance['nav_menu'];
+ $instance = array();
+ if ( ! empty( $new_instance['title'] ) ) {
+ $instance['title'] = strip_tags( stripslashes($new_instance['title']) );
+ }
+ if ( ! empty( $new_instance['nav_menu'] ) ) {
+ $instance['nav_menu'] = (int) $new_instance['nav_menu'];
+ }
return $instance;
}