source: codepress-admin-columns/trunk/classes/Column/User/CommentCount.php @ 2293580
Last change on this file since 2293580 was 2293580, checked in by , 5 years ago | |
---|---|
File size: 420 bytes |
Line | |
---|---|
1 | <?php |
2 | |
3 | namespace AC\Column\User; |
4 | |
5 | use AC\Column; |
6 | |
7 | /** |
8 | * @since 2.0 |
9 | */ |
10 | class CommentCount extends Column { |
11 | |
12 | public function __construct() { |
13 | $this->set_type( 'column-user_commentcount' ); |
14 | $this->set_label( __( 'Comment Count', 'codepress-admin-columns' ) ); |
15 | } |
16 | |
17 | public function get_raw_value( $user_id ) { |
18 | return get_comments( [ |
19 | 'user_id' => $user_id, |
20 | 'count' => true, |
21 | 'orderby' => false, |
22 | ] ); |
23 | } |
24 | |
25 | } |
Note: See TracBrowser for help on using the repository browser.