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
registered.php
56 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CPAC_Column_User_Registered |
| 4 | * |
| 5 | * @since 2.0 |
| 6 | */ |
| 7 | class CPAC_Column_User_Registered 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_registered'; |
| 19 | $this->properties['label'] = __( 'Registered', 'codepress-admin-columns' ); |
| 20 | |
| 21 | // Options |
| 22 | $this->options['date_format'] = ''; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @see CPAC_Column::get_value() |
| 27 | * @since 2.0 |
| 28 | */ |
| 29 | function get_value( $user_id ) { |
| 30 | |
| 31 | $user_registered = $this->get_raw_value( $user_id ); |
| 32 | |
| 33 | // GMT offset is used |
| 34 | return $this->get_date( get_date_from_gmt( $user_registered ), $this->options->date_format ); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @see CPAC_Column::get_raw_value() |
| 39 | * @since 2.0.3 |
| 40 | */ |
| 41 | function get_raw_value( $user_id ) { |
| 42 | |
| 43 | $userdata = get_userdata( $user_id ); |
| 44 | |
| 45 | return $userdata->user_registered; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @see CPAC_Column::display_settings() |
| 50 | * @since 2.0 |
| 51 | */ |
| 52 | function display_settings() { |
| 53 | |
| 54 | $this->display_field_date_format(); |
| 55 | } |
| 56 | } |