Friends.php
1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace ACA\BP\Column\User;
use AC;
use ACA\BP\Filtering;
use ACP;
class Friends extends AC\Column\Meta
implements ACP\Sorting\Sortable, ACP\Filtering\Filterable, ACP\Search\Searchable, ACP\ConditionalFormat\Formattable {
use ACP\ConditionalFormat\IntegerFormattableTrait;
public function __construct() {
$this->set_type( 'column-buddypress_user_friends' )
->set_label( __( 'Friends', 'buddypress' ) )
->set_group( 'buddypress' );
}
public function get_meta_key() {
return 'total_friend_count';
}
public function is_valid() {
return bp_is_active( 'friends' );
}
public function get_raw_value( $id ) {
return bp_get_total_friend_count( $id );
}
public function sorting() {
return new ACP\Sorting\Model\User\Meta( $this->get_meta_key() );
}
public function search() {
return new ACP\Search\Comparison\Meta\Number( $this->get_meta_key(), $this->get_meta_type() );
}
public function filtering() {
return new Filtering\User\Friends( $this );
}
}