ID.php
10 years ago
actions.php
10 years ago
comment-count.php
10 years ago
description.php
10 years ago
display-name.php
10 years ago
first-name.php
10 years ago
last-name.php
10 years ago
nickname.php
10 years ago
post-count.php
10 years ago
registered.php
10 years ago
rich-editing.php
10 years ago
url.php
10 years ago
description.php
51 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_User_Description |
| 4 | * |
| 5 | * @since 2.0 |
| 6 | */ |
| 7 | class CPAC_Column_User_Description 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-user_description'; |
| 19 | $this->properties['label'] = __( 'Description', 'codepress-admin-columns' ); |
| 20 | |
| 21 | // Options |
| 22 | $this->options['excerpt_length'] = 30; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @see CPAC_Column::get_value() |
| 27 | * @since 2.0 |
| 28 | */ |
| 29 | function get_value( $user_id ) { |
| 30 | |
| 31 | return $this->get_raw_value( $user_id ); |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * @see CPAC_Column::get_raw_value() |
| 36 | * @since 2.0.3 |
| 37 | */ |
| 38 | function get_raw_value( $user_id ) { |
| 39 | |
| 40 | return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->options->excerpt_length ); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @see CPAC_Column::display_settings() |
| 45 | * @since 2.0 |
| 46 | */ |
| 47 | function display_settings() { |
| 48 | |
| 49 | $this->display_field_excerpt_length(); |
| 50 | } |
| 51 | } |