ID.php
12 years ago
actions.php
12 years ago
comment-count.php
12 years ago
description.php
12 years ago
first-name.php
12 years ago
last-name.php
12 years ago
nickname.php
12 years ago
post-count.php
12 years ago
registered.php
12 years ago
url.php
12 years ago
description.php
39 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * CPAC_Column_User_Description |
| 5 | * |
| 6 | * @since 2.0.0 |
| 7 | */ |
| 8 | class CPAC_Column_User_Description extends CPAC_Column { |
| 9 | |
| 10 | function __construct( $storage_model ) { |
| 11 | |
| 12 | // define properties |
| 13 | $this->properties['type'] = 'column-user_description'; |
| 14 | $this->properties['label'] = __( 'Description', 'cpac' ); |
| 15 | |
| 16 | // define additional options |
| 17 | $this->options['excerpt_length'] = 30; |
| 18 | |
| 19 | parent::__construct( $storage_model ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @see CPAC_Column::get_value() |
| 24 | * @since 2.0.0 |
| 25 | */ |
| 26 | function get_value( $user_id ) { |
| 27 | |
| 28 | return $this->get_shortened_string( get_the_author_meta( 'user_description', $user_id ), $this->options->excerpt_length ); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * @see CPAC_Column::display_settings() |
| 33 | * @since 2.0.0 |
| 34 | */ |
| 35 | function display_settings() { |
| 36 | |
| 37 | $this->display_field_excerpt_length(); |
| 38 | } |
| 39 | } |