ID.php
10 years ago
actions.php
10 years ago
attachment-count.php
10 years ago
attachment.php
10 years ago
author-name.php
10 years ago
before-moretag.php
10 years ago
comment-count.php
10 years ago
comment-status.php
10 years ago
content.php
10 years ago
date-published.php
10 years ago
depth.php
10 years ago
estimated-reading-time.php
10 years ago
excerpt.php
10 years ago
featured-image.php
10 years ago
formats.php
10 years ago
last-modified-author.php
10 years ago
modified.php
10 years ago
order.php
10 years ago
page-template.php
10 years ago
parent.php
10 years ago
path.php
10 years ago
permalink.php
10 years ago
ping-status.php
10 years ago
roles.php
10 years ago
shortcodes.php
10 years ago
slug.php
10 years ago
status.php
10 years ago
sticky.php
10 years ago
title-raw.php
10 years ago
word-count.php
10 years ago
date-published.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @since 2.4 |
| 4 | */ |
| 5 | class CPAC_Column_Post_Date_Published extends CPAC_Column { |
| 6 | |
| 7 | /** |
| 8 | * @see CPAC_Column::init() |
| 9 | * @since 2.4 |
| 10 | */ |
| 11 | public function init() { |
| 12 | |
| 13 | parent::init(); |
| 14 | |
| 15 | // Properties |
| 16 | $this->properties['type'] = 'column-date_published'; |
| 17 | $this->properties['label'] = __( 'Date Published' ); |
| 18 | |
| 19 | // Options |
| 20 | $this->options['date_format'] = ''; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @see CPAC_Column::get_value() |
| 25 | * @since 2.4 |
| 26 | */ |
| 27 | public function get_value( $post_id ) { |
| 28 | |
| 29 | $raw_value = $this->get_raw_value( $post_id ); |
| 30 | |
| 31 | if ( ! $this->get_option( 'date_format' ) ) { |
| 32 | return $this->get_date( $raw_value ) . ' ' . $this->get_time( $raw_value ); |
| 33 | } |
| 34 | |
| 35 | return $this->get_date( $raw_value, $this->get_option( 'date_format' ) ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @see CPAC_Column::get_raw_value() |
| 40 | * @since 2.4 |
| 41 | */ |
| 42 | public function get_raw_value( $post_id ) { |
| 43 | $post = get_post( $post_id ); |
| 44 | return $post->post_date; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @see CPAC_Column::display_settings() |
| 49 | * @since 2.4 |
| 50 | */ |
| 51 | public function display_settings() { |
| 52 | parent::display_settings(); |
| 53 | $this->display_field_date_format(); |
| 54 | } |
| 55 | } |