# friends/2.7.4/widgets/class-widget-recent-friends-list.php

Friends, version 2.7.4. 56 lines.

- Page: https://pluginprobe.com/plugins/friends/2.7.4/code/widgets/class-widget-recent-friends-list.php
- Raw: https://pluginprobe.com/plugins/friends/2.7.4/raw/widgets/class-widget-recent-friends-list.php
- Modified: 2022-11-13T14:21:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/friends/2.7.4/code/widgets/class-widget-recent-friends-list.php#L10-L20`.

```php
<?php
/**
 * Friend List Widget
 *
 * A widget that displays a list of your friends.
 *
 * @package Friends
 * @since 0.3
 */

namespace Friends;

/**
 * This is the class for the Friend List Widget.
 *
 * @package Friends
 * @author Alex Kirk
 */
class Widget_Recent_Friends_List extends Widget_Base_Friends_List {
	/**
	 * Constructor
	 */
	public function __construct() {
		parent::__construct(
			'friends-widget-recent-friend-list',
			__( 'Recent Friend List', 'friends' ),
			array(
				'description' => __( 'Shows a list of your Recent friends and subscriptions.', 'friends' ),
			)
		);
	}

	/**
	 * Render the widget.
	 *
	 * @param array $args Sidebar arguments.
	 * @param array $instance Widget instance settings.
	 */
	public function widget( $args, $instance ) {
		$instance = wp_parse_args( $instance, $this->defaults() );

		echo $args['before_widget'];

		$this->list_friends(
			$args,
			__( 'Recent Friends', 'friends' ),
			User_Query::recent_friends_subscriptions( 5 )
		);

		do_action( 'friends_widget_lastest_friend_list_after', $this, $args );

		echo $args['after_widget'];
	}
}


```
