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
reply-to.php
44 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_Comment_Reply_To |
| 4 | * |
| 5 | * @since 2.0 |
| 6 | */ |
| 7 | class CPAC_Column_Comment_Reply_To extends CPAC_Column { |
| 8 | |
| 9 | /** |
| 10 | * @see CPAC_Column::init() |
| 11 | * @since 2.2.1 |
| 12 | */ |
| 13 | public function init() { |
| 14 | |
| 15 | parent::init(); |
| 16 | |
| 17 | // Properties |
| 18 | $this->properties['type'] = 'column-reply_to'; |
| 19 | $this->properties['label'] = __( 'In Reply To', 'codepress-admin-columns' ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @see CPAC_Column::get_value() |
| 24 | * @since 2.0 |
| 25 | */ |
| 26 | public function get_value( $id ) { |
| 27 | $value = ''; |
| 28 | $parent = $this->get_raw_value( $id ); |
| 29 | if ( $parent ) { |
| 30 | $parent = get_comment( $parent ); |
| 31 | $value = sprintf( '<a href="%1$s">%2$s</a>', esc_url( get_comment_link( $parent ) ), get_comment_author( $parent->comment_ID ) ); |
| 32 | } |
| 33 | |
| 34 | return $value; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @since 2.4.2 |
| 39 | */ |
| 40 | public function get_raw_value( $id ) { |
| 41 | $comment = get_comment( $id ); |
| 42 | return $comment->comment_parent; |
| 43 | } |
| 44 | } |