X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/888fa4ed68091f3314f711c5f6fe75858bf5410b..8ab4a4532479e8db471032b51042ec8c4716d091:/wp-includes/default-widgets.php
diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php
index e48cc01f..748fc9ae 100644
--- a/wp-includes/default-widgets.php
+++ b/wp-includes/default-widgets.php
@@ -13,13 +13,12 @@
*/
class WP_Widget_Pages extends WP_Widget {
- function __construct() {
+ public function __construct() {
$widget_ops = array('classname' => 'widget_pages', 'description' => __( 'A list of your site’s Pages.') );
parent::__construct('pages', __('Pages'), $widget_ops);
}
- function widget( $args, $instance ) {
- extract( $args );
+ public function widget( $args, $instance ) {
/**
* Filter the widget title.
@@ -54,20 +53,21 @@ 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'];
+ }
?>
'post_title', 'title' => '', 'exclude' => '') );
$title = esc_attr( $instance['title'] );
@@ -113,13 +113,12 @@ class WP_Widget_Pages extends WP_Widget {
*/
class WP_Widget_Links extends WP_Widget {
- function __construct() {
+ public function __construct() {
$widget_ops = array('description' => __( "Your blogroll" ) );
parent::__construct('links', __('Links'), $widget_ops);
}
- function widget( $args, $instance ) {
- extract($args, EXTR_SKIP);
+ public function widget( $args, $instance ) {
$show_description = isset($instance['description']) ? $instance['description'] : false;
$show_name = isset($instance['name']) ? $instance['name'] : false;
@@ -130,7 +129,7 @@ class WP_Widget_Links extends WP_Widget {
$order = $orderby == 'rating' ? 'DESC' : 'ASC';
$limit = isset( $instance['limit'] ) ? $instance['limit'] : -1;
- $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);
+ $before_widget = preg_replace( '/id="[^"]*"/', 'id="%id"', $args['before_widget'] );
/**
* Filter the arguments for the Links widget.
@@ -142,8 +141,8 @@ class WP_Widget_Links extends WP_Widget {
* @param array $args An array of arguments to retrieve the links list.
*/
wp_list_bookmarks( apply_filters( 'widget_links_args', array(
- 'title_before' => $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',
@@ -152,7 +151,7 @@ class WP_Widget_Links extends WP_Widget {
) ) );
}
- function update( $new_instance, $old_instance ) {
+ public function update( $new_instance, $old_instance ) {
$new_instance = (array) $new_instance;
$instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0 );
foreach ( $instance as $field => $val ) {
@@ -170,7 +169,7 @@ class WP_Widget_Links extends WP_Widget {
return $instance;
}
- function form( $instance ) {
+ public function form( $instance ) {
//Defaults
$instance = wp_parse_args( (array) $instance, array( 'images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false, 'orderby' => 'name', 'limit' => -1 ) );
@@ -223,28 +222,28 @@ class WP_Widget_Links extends WP_Widget {
*/
class WP_Widget_Search extends WP_Widget {
- function __construct() {
+ public function __construct() {
$widget_ops = array('classname' => 'widget_search', 'description' => __( "A search form for your site.") );
parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops );
}
- function widget( $args, $instance ) {
- extract($args);
+ public function widget( $args, $instance ) {
/** 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 ) {
+ public function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '') );
$title = $instance['title'];
?>
@@ -252,7 +251,7 @@ class WP_Widget_Search extends WP_Widget {
''));
$instance['title'] = strip_tags($new_instance['title']);
@@ -268,28 +267,28 @@ class WP_Widget_Search extends WP_Widget {
*/
class WP_Widget_Archives extends WP_Widget {
- function __construct() {
+ public function __construct() {
$widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site’s Posts.') );
parent::__construct('archives', __('Archives'), $widget_ops);
}
- function widget( $args, $instance ) {
- extract($args);
+ public function widget( $args, $instance ) {
$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 ) {
+ $dropdown_id = "{$this->id_base}-dropdown-{$this->number}";
?>
-