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
excerpt.php
40 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_Comment_Excerpt |
| 4 | * |
| 5 | * @since 2.0.0 |
| 6 | */ |
| 7 | class CPAC_Column_Comment_Excerpt extends CPAC_Column { |
| 8 | |
| 9 | function __construct( $storage_model ) { |
| 10 | |
| 11 | // define properties |
| 12 | $this->properties['type'] = 'column-excerpt'; |
| 13 | $this->properties['label'] = __( 'Excerpt', 'cpac' ); |
| 14 | |
| 15 | // define additional options |
| 16 | $this->options['excerpt_length'] = 15; |
| 17 | |
| 18 | parent::__construct( $storage_model ); |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * @see CPAC_Column::get_value() |
| 23 | * @since 2.0.0 |
| 24 | */ |
| 25 | function get_value( $id ) { |
| 26 | |
| 27 | $comment = get_comment( $id ); |
| 28 | |
| 29 | return $this->get_shortened_string( $comment->comment_content, $this->options->excerpt_length ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @see CPAC_Column::display_settings() |
| 34 | * @since 2.0.0 |
| 35 | */ |
| 36 | function display_settings() { |
| 37 | |
| 38 | $this->display_field_excerpt_length(); |
| 39 | } |
| 40 | } |