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
excerpt.php
48 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_Comment_Excerpt |
| 4 | * |
| 5 | * @since 2.0 |
| 6 | */ |
| 7 | class CPAC_Column_Comment_Excerpt 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-excerpt'; |
| 19 | $this->properties['label'] = __( 'Content', 'codepress-admin-columns' ); |
| 20 | |
| 21 | // Options |
| 22 | $this->options['excerpt_length'] = 15; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @see CPAC_Column::get_value() |
| 27 | * @since 2.0 |
| 28 | */ |
| 29 | public function get_value( $id ) { |
| 30 | return $this->get_shortened_string( $this->get_raw_value( $id ), $this->options->excerpt_length ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @since 2.4.2 |
| 35 | */ |
| 36 | public function get_raw_value( $id ) { |
| 37 | $comment = get_comment( $id ); |
| 38 | return $comment->comment_content; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * @see CPAC_Column::display_settings() |
| 43 | * @since 2.0 |
| 44 | */ |
| 45 | public function display_settings() { |
| 46 | $this->display_field_excerpt_length(); |
| 47 | } |
| 48 | } |