Agent.php
8 years ago
Approved.php
8 years ago
Author.php
8 years ago
AuthorAvatar.php
8 years ago
AuthorEmail.php
8 years ago
AuthorIP.php
8 years ago
AuthorName.php
8 years ago
AuthorUrl.php
8 years ago
Comment.php
8 years ago
Date.php
8 years ago
DateGmt.php
8 years ago
Excerpt.php
8 years ago
ID.php
8 years ago
Post.php
8 years ago
ReplyTo.php
8 years ago
Response.php
8 years ago
Status.php
8 years ago
Type.php
8 years ago
User.php
8 years ago
WordCount.php
8 years ago
User.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | exit; |
| 5 | } |
| 6 | |
| 7 | /** |
| 8 | * @since 2.4.2 |
| 9 | */ |
| 10 | class AC_Column_Comment_User extends AC_Column { |
| 11 | |
| 12 | public function __construct() { |
| 13 | $this->set_type( 'column-user' ); |
| 14 | $this->set_label( __( 'User', 'codepress-admin-columns' ) ); |
| 15 | } |
| 16 | |
| 17 | public function get_value( $id ) { |
| 18 | $raw_value = $this->get_raw_value( $id ); |
| 19 | |
| 20 | return $this->get_formatted_value( $raw_value, $raw_value ); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @param int $comment_id Comment ID |
| 25 | * |
| 26 | * @return int User ID |
| 27 | */ |
| 28 | public function get_raw_value( $comment_id ) { |
| 29 | $comment = get_comment( $comment_id ); |
| 30 | |
| 31 | return $comment->user_id; |
| 32 | } |
| 33 | |
| 34 | public function register_settings() { |
| 35 | $this->add_setting( new AC_Settings_Column_User( $this ) ); |
| 36 | } |
| 37 | |
| 38 | } |
| 39 |