Hello,
I am very new to Meta Box. I am tying to show the featured images in my admin column. The post-type is called team-member and each post has an image. I am using the following snippet in the wp plugin snippets, but as soon as I save and activate it, the site breaks it & tells me -> MB_Admin_Columns_Post is unknown ...
add_action( 'admin_init', function() {
class My_Featured_Image_Columns extends MB_Admin_Columns_Post {
public function columns( $columns ) {
$columns = parent::columns( $columns );
$position = 'before';
$target = 'title';
$this->add( $columns, 'featured_image', 'Featured Image', $position, $target );
// Add more if you want
return $columns;
}
public function show( $column, $post_id ) {
switch ( $column ) {
case 'featured_image':
the_post_thumbnail( [40, 40] );
break;
// More columns
}
}
}
new My_Featured_Image_Columns( 'team-member', array() );
} );