Current Path : /var/test/www/ya/wp-content/plugins/meanthemes-tools/include/ |
Current File : /var/test/www/ya/wp-content/plugins/meanthemes-tools/include/enhance.php |
<?php // Featured image column add_image_size('featured_preview', 110, 110, true); // Get Featured Image function meanthemes_get_featured_image($post_ID) { $post_thumbnail_id = get_post_thumbnail_id($post_ID); if ($post_thumbnail_id) { $post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview'); return $post_thumbnail_img[0]; } } // Add the new Column function meanthemes_columns_head($defaults) { $defaults['featured_image'] = 'Featured Image'; return $defaults; } // Now Show the Featured image function meanthemes_columns_content($column_name, $post_ID) { if ($column_name == 'featured_image') { $post_featured_image = meanthemes_get_featured_image($post_ID); if ($post_featured_image) { echo '<img src="' . $post_featured_image . '" height="55" />'; } } } add_filter('manage_posts_columns', 'meanthemes_columns_head'); add_action('manage_posts_custom_column', 'meanthemes_columns_content', 10, 2); ?>