'users', 'description' => __('An advanced widget that gives you total control over the output of your user lists.','members') );
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'members-widget-users' );
$this->WP_Widget( 'members-widget-users', __('Users', 'members'), $widget_ops, $control_ops );
}
function widget( $args, $instance ) {
extract( $args, EXTR_SKIP );
$title = apply_filters('widget_title', $instance['title'] );
$limit = $instance['limit'];
$order = $instance['order'];
$orderby = $instance['orderby'];
$exclude = $instance['exclude'];
$include = $instance['include'];
$show_fullname = isset( $instance['show_fullname'] ) ? $instance['show_fullname'] : false;
$users = array(
'limit' => $limit,
'order' => $order,
'orderby' => $orderby,
'include' => $include,
'exclude' => $exclude,
'show_fullname' => $show_fullname,
'echo' => 0,
);
echo $before_widget;
if ( $title )
echo "\n\t\t\t" . $before_title . $title . $after_title;
echo "\n\t\t\t" . '
';
echo "\n\t\t\t\t" . str_replace( array( "\r", "\n", "\t" ), '', members_list_users( $users ) );
echo "\n\t\t\t" . '
';
echo $after_widget;
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['limit'] = strip_tags( $new_instance['limit'] );
$instance['include'] = strip_tags( $new_instance['include'] );
$instance['exclude'] = strip_tags( $new_instance['exclude'] );
$instance['order'] = $new_instance['order'];
$instance['orderby'] = $new_instance['orderby'];
$instance['show_fullname'] = $new_instance['show_fullname'];
return $instance;
}
function form( $instance ) {
//Defaults
$defaults = array( 'title' => __('Users', 'members'), 'show_fullname' => true, 'order' => 'ASC', 'orderby' => 'display_name' );
$instance = wp_parse_args( (array) $instance, $defaults ); ?>