__( 'A widget that shows article contributors', 'accesspress-mag' ) ) ); } /** * Helper function that holds widget fields * Array is used in update and form functions */ private function widget_fields() { $fields = array( 'contributors_title' => array( 'accesspress_mag_widgets_name' => 'contributors_title', 'accesspress_mag_widgets_title' => __( 'Title', 'accesspress-mag' ), 'accesspress_mag_widgets_field_type' => 'title', ), ); return $fields; } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { extract($args); $contributors_title = $instance['contributors_title']; echo $before_widget; ?>
'; // print_r($user_query); // echo ''; if ( ! empty( $user_query->results ) ) { foreach ( $user_query->results as $user ) { $user_name = $user->display_name; $user_nickname = $user->user_nicename; $user_id = $user->ID; $user_avatar = get_avatar($user_id, '82'); ?>