Plugin Directory

source: codepress-admin-columns/trunk/classes/Column/User/CommentCount.php @ 2293580

Last change on this file since 2293580 was 2293580, checked in by tschutter, 5 years ago

trunk

File size: 420 bytes
Line 
1<?php
2
3namespace AC\Column\User;
4
5use AC\Column;
6
7/**
8 * @since 2.0
9 */
10class 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.