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
featured-image.php
46 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * CPAC_Column_Post_Featured_Image |
| 5 | * |
| 6 | * @since 2.0.0 |
| 7 | */ |
| 8 | class CPAC_Column_Post_Featured_Image extends CPAC_Column { |
| 9 | |
| 10 | function __construct( $storage_model ) { |
| 11 | |
| 12 | // define properties |
| 13 | $this->properties['type'] = 'column-featured_image'; |
| 14 | $this->properties['label'] = __( 'Featured Image', 'cpac' ); |
| 15 | |
| 16 | // define additional options |
| 17 | $this->options['image_size'] = ''; |
| 18 | $this->options['image_size_w'] = 80; |
| 19 | $this->options['image_size_h'] = 80; |
| 20 | |
| 21 | parent::__construct( $storage_model ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * @see CPAC_Column::get_value() |
| 26 | * @since 2.0.0 |
| 27 | */ |
| 28 | function get_value( $post_id ) { |
| 29 | if ( ! has_post_thumbnail( $post_id ) ) |
| 30 | return false; |
| 31 | |
| 32 | $thumb = implode( $this->get_thumbnails( get_post_thumbnail_id( $post_id ), (array) $this->options ) ); |
| 33 | $link = get_edit_post_link( $post_id ); |
| 34 | |
| 35 | return $link ? "<a href='{$link}#postimagediv'>{$thumb}</a>" : $thumb; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * @see CPAC_Column::display_settings() |
| 40 | * @since 2.0.0 |
| 41 | */ |
| 42 | function display_settings() { |
| 43 | |
| 44 | $this->display_field_preview_size(); |
| 45 | } |
| 46 | } |