Permalink
Browse files

Update the widget so that it can be used in the_widget(). Other minor…

… cleanup.

git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@995 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
1 parent 2a74566 commit 144a275b5710a21184d73f92d1743a0bea846021 greenshady committed Feb 28, 2012
Showing with 12 additions and 20 deletions.
  1. +12 −20 classes/widget-authors.php
View
@@ -16,13 +16,12 @@
* Authors Widget Class
*
* @since 0.6.0
- * @link http://codex.wordpress.org/Template_Tags/wp_list_authors
- * @link http://themehybrid.com/themes/hybrid/widgets
*/
class Hybrid_Widget_Authors extends WP_Widget {
/**
* Set up the widget's unique name, ID, class, description, and other options.
+ *
* @since 1.2.0
*/
function __construct() {
@@ -50,26 +49,17 @@ function __construct() {
/**
* Outputs the widget based on the arguments input through the widget controls.
+ *
* @since 0.6.0
*/
- function widget( $args, $instance ) {
- extract( $args, EXTR_SKIP );
-
- /* Set up the arguments for wp_list_authors(). */
- $args = array(
- 'order' => $instance['order'],
- 'orderby' => $instance['orderby'],
- 'number' => !empty( $instance['number'] ) ? intval( $instance['number'] ) : '',
- 'style' => $instance['style'],
- 'feed' => $instance['feed'],
- 'feed_image' => $instance['feed_image'],
- 'optioncount' => !empty( $instance['optioncount'] ) ? true : false,
- 'exclude_admin' => !empty( $instance['exclude_admin'] ) ? true : false,
- 'show_fullname' => !empty( $instance['show_fullname'] ) ? true : false,
- 'hide_empty' => !empty( $instance['hide_empty'] ) ? true : false,
- 'html' => !empty( $instance['html'] ) ? true : false,
- 'echo' => false
- );
+ function widget( $sidebar, $instance ) {
+ extract( $sidebar );
+
+ /* Set the $args for wp_list_authors() to the $instance array. */
+ $args = $instance;
+
+ /* Overwrite the $echo argument and set it to false. */
+ $args['echo'] = false;
/* Output the theme's $before_widget wrapper. */
echo $before_widget;
@@ -94,6 +84,7 @@ function widget( $args, $instance ) {
/**
* Updates the widget control options for the particular instance of the widget.
+ *
* @since 0.6.0
*/
function update( $new_instance, $old_instance ) {
@@ -118,6 +109,7 @@ function update( $new_instance, $old_instance ) {
/**
* Displays the widget control options in the Widgets admin screen.
+ *
* @since 0.6.0
*/
function form( $instance ) {

0 comments on commit 144a275

Please sign in to comment.