ID.php
12 years ago
actions.php
12 years ago
attachment-count.php
12 years ago
attachment.php
12 years ago
author-name.php
12 years ago
before-moretag.php
12 years ago
comment-count.php
12 years ago
comment-status.php
12 years ago
excerpt.php
12 years ago
featured-image.php
12 years ago
formats.php
12 years ago
modified.php
12 years ago
order.php
12 years ago
page-template.php
12 years ago
parent.php
12 years ago
ping-status.php
12 years ago
roles.php
12 years ago
slug.php
12 years ago
status.php
12 years ago
sticky.php
12 years ago
taxonomy.php
12 years ago
word-count.php
12 years ago
status.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * CPAC_Column_Post_Status |
| 5 | * |
| 6 | * @since 2.0.0 |
| 7 | */ |
| 8 | class CPAC_Column_Post_Status extends CPAC_Column { |
| 9 | |
| 10 | function __construct( $storage_model ) { |
| 11 | |
| 12 | // define properties |
| 13 | $this->properties['type'] = 'column-status'; |
| 14 | $this->properties['label'] = __( 'Status', 'cpac' ); |
| 15 | |
| 16 | parent::__construct( $storage_model ); |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * @see CPAC_Column::get_value() |
| 21 | * @since 2.0.0 |
| 22 | */ |
| 23 | function get_value( $post_id ) { |
| 24 | |
| 25 | $value = ''; |
| 26 | |
| 27 | $p = get_post( $post_id ); |
| 28 | |
| 29 | $builtin_status = array( |
| 30 | 'publish' => __( 'Published', 'cpac' ), |
| 31 | 'draft' => __( 'Draft', 'cpac' ), |
| 32 | 'future' => __( 'Scheduled', 'cpac' ) . " <p class='description'>" . date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) , strtotime( $p->post_date ) ) . "</p>", |
| 33 | 'private' => __( 'Private', 'cpac' ), |
| 34 | 'pending' => __( 'Pending Review', 'cpac' ), |
| 35 | 'trash' => __( 'Trash', 'cpac' ), |
| 36 | ); |
| 37 | |
| 38 | if ( isset( $builtin_status[ $p->post_status ] ) ) |
| 39 | $value = $builtin_status[ $p->post_status ]; |
| 40 | |
| 41 | return $value; |
| 42 | } |
| 43 | } |