ID.php
10 years ago
actions.php
10 years ago
agent.php
10 years ago
approved.php
10 years ago
author-avatar.php
10 years ago
author-email.php
10 years ago
author-ip.php
10 years ago
author-name.php
10 years ago
author-url.php
10 years ago
author.php
10 years ago
date-gmt.php
10 years ago
date.php
10 years ago
excerpt.php
10 years ago
post.php
10 years ago
reply-to.php
10 years ago
type.php
10 years ago
user.php
10 years ago
word-count.php
10 years ago
user.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @since 2.4.2 |
| 4 | */ |
| 5 | class CPAC_Column_Comment_User extends CPAC_Column { |
| 6 | |
| 7 | public function init() { |
| 8 | parent::init(); |
| 9 | |
| 10 | $this->properties['type'] = 'column-user'; |
| 11 | $this->properties['label'] = __( 'User', 'codepress-admin-columns' ); |
| 12 | } |
| 13 | |
| 14 | public function get_value( $id ) { |
| 15 | $user_id = $this->get_raw_value( $id ); |
| 16 | |
| 17 | if ( ! $user_id ) { |
| 18 | return false; |
| 19 | } |
| 20 | |
| 21 | $display_name = $this->get_display_name( $user_id ); |
| 22 | if ( $edit_link = get_edit_profile_url( $user_id ) ) { |
| 23 | $display_name = '<a href="' . $edit_link . ' ">' . $display_name . '</a>'; |
| 24 | } |
| 25 | return $display_name; |
| 26 | } |
| 27 | |
| 28 | public function get_raw_value( $id ) { |
| 29 | $comment = get_comment( $id ); |
| 30 | return $comment->user_id; |
| 31 | } |
| 32 | } |