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
date.php
46 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_Comment_Date |
| 4 | * |
| 5 | * @since 2.0 |
| 6 | */ |
| 7 | class CPAC_Column_Comment_Date 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-date'; |
| 19 | $this->properties['label'] = __( 'Date', 'codepress-admin-columns' ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @see CPAC_Column::get_value() |
| 24 | * @since 2.0 |
| 25 | */ |
| 26 | public function get_value( $id ) { |
| 27 | |
| 28 | $date = $this->get_raw_value( $id ); |
| 29 | |
| 30 | $value = sprintf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), |
| 31 | esc_url( get_comment_link( $id ) ), |
| 32 | $this->get_date( $date ), |
| 33 | $this->get_time( $date ) |
| 34 | ); |
| 35 | |
| 36 | return "<div class='submitted-on'>{$value}</div>"; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @since 2.4.2 |
| 41 | */ |
| 42 | public function get_raw_value( $id ) { |
| 43 | $comment = get_comment( $id ); |
| 44 | return $comment->comment_date; |
| 45 | } |
| 46 | } |