Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Resolved bug with columns _thumbnail_id #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions includes/class-super-custom-post-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public function prune_options( $options, $meta_key, $post_meta, $default_args =
$this_args['id'] .= "_$key";

if ( 'input' == $tag ) {
if ( ( isset( $post_meta[ $meta_key ] ) && in_array( $this_args['value'], $post_meta[ $meta_key ] ) ) || ( ! isset( $post_meta[ $meta_key ] ) && in_array( $this_args['value'], (array) $default ) ) )
if ( ( isset( $post_meta[ $meta_key ] ) && in_array( strval($this_args['value']), $post_meta[ $meta_key ],true ) ) || ( ! isset( $post_meta[ $meta_key ] ) && in_array( $this_args['value'], (array) $default ) ) )
$this_args['checked'] = 'checked';
$html[] = SCPT_Markup::tag( 'label', array(
'for' => $this_args['id'],
Expand Down Expand Up @@ -805,7 +805,12 @@ public function format_meta_for_list( $data, $key ) {
if ( false == $field_info ) {
switch ( $key ) {
case '_thumbnail_id' :
return wp_get_attachment_image( $data, $this->column_thumbnail_size, true );
if(!is_array($data)){
return wp_get_attachment_image( $data, $this->column_thumbnail_size, true );
}else{
return 'N/A';
}
return ;
}
} elseif ( is_array( $field_info ) ) {
# This is a cpt relationship
Expand Down