PluginProbe
Friends / 4.3.0
Friends v4.3.0
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / widgets / class-widget-recent-friends-list.php

class-widget-recent-friends-list.php in Friends 4.3.0, at widgets/class-widget-recent-friends-list.php

54 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Friend List Widget
4 *
5 * A widget that displays a list of your friends.
6 *
7 * @package Friends
8 * @since 0.3
9 */
10
11 namespace Friends;
12
13 /**
14 * This is the class for the Friend List Widget.
15 *
16 * @package Friends
17 * @author Alex Kirk
18 */
19 class Widget_Recent_Friends_List extends Widget_Base_Friends_List {
20 /**
21 * Constructor
22 */
23 public function __construct() {
24 parent::__construct(
25 'friends-widget-recent-friend-list',
26 __( 'Recent Friend List', 'friends' ),
27 array(
28 'description' => __( 'Shows a list of your recent friends and people you follow.', 'friends' ),
29 )
30 );
31 }
32
33 /**
34 * Render the widget.
35 *
36 * @param array $args Sidebar arguments.
37 * @param array $instance Widget instance settings.
38 */
39 public function widget( $args, $instance ) {
40 $instance = wp_parse_args( $instance, $this->defaults() );
41
42 echo $args['before_widget'];
43 $this->list_friends(
44 $args,
45 '<span class="dashicons dashicons-admin-users"></span> ' . __( 'Recent Friends', 'friends' ),
46 User_Query::recent_friends_subscriptions( 5 )
47 );
48
49 do_action( 'friends_widget_lastest_friend_list_after', $this, $args );
50
51 echo $args['after_widget'];
52 }
53 }
54