ID.php
12 years ago
actions.php
12 years ago
agent.php
12 years ago
approved.php
12 years ago
author-avatar.php
12 years ago
author-email.php
12 years ago
author-ip.php
12 years ago
author-url.php
12 years ago
author.php
12 years ago
date-gmt.php
12 years ago
date.php
12 years ago
excerpt.php
12 years ago
reply-to.php
12 years ago
word-count.php
12 years ago
reply-to.php
34 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_Comment_Reply_To |
| 4 | * |
| 5 | * @since 2.0.0 |
| 6 | */ |
| 7 | class CPAC_Column_Comment_Reply_To extends CPAC_Column { |
| 8 | |
| 9 | function __construct( $storage_model ) { |
| 10 | |
| 11 | $this->properties['type'] = 'column-reply_to'; |
| 12 | $this->properties['label'] = __( 'In Reply To', 'cpac' ); |
| 13 | |
| 14 | parent::__construct( $storage_model ); |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * @see CPAC_Column::get_value() |
| 19 | * @since 2.0.0 |
| 20 | */ |
| 21 | function get_value( $id ) { |
| 22 | |
| 23 | $value = ''; |
| 24 | |
| 25 | $comment = get_comment( $id ); |
| 26 | |
| 27 | if ( $comment->comment_parent ) { |
| 28 | $parent = get_comment( $comment->comment_parent ); |
| 29 | $value = sprintf( '<a href="%1$s">%2$s</a>', esc_url( get_comment_link( $comment->comment_parent ) ), get_comment_author( $parent->comment_ID ) ); |
| 30 | } |
| 31 | |
| 32 | return $value; |
| 33 | } |
| 34 | } |