
Featured Image Column
v1.2.0Austin · 2011年9月14日 上架
Adds a column to any post type edit screen with the featured image if it exists.
- 正在使用
- 2,000+
- 评分
- 4.5 / 5
- 累计下载
- 4.9 万
- 最近更新
- 2026年8月15日
12 条评价需要 WordPress 6.2+已测试到 7.1.0PHP 8.0+
截图
As of version 0.2.2 you can select which post types you’d like to have the image column.
It simply adds a column before the title (far left) the show’s the posts featured image if it’s supported and exists.
Want to change the default image? Simply filter you own image by using featured_image_column_default_image
or filter your own CSS by using the featured_image_column_css filter hook.
Example actions/filters
Change thumbnail size
function my_custom_featured_image_size(mixed $size, int $post_id): mixed {
if (in_array($post_id, [1, 5, 23], true)) {
return [65. 65];
}
return $size;
}
add_filter('featured_image_post_thumbnail_size', 'my_custom_featured_image_size', 10, 2);
Add support for a custom default image
function my_custom_featured_image_column_image(string $image, int $post_id): string {
if (in_array($post_id, [1, 5, 23], true)) {
return trailingslashit( get_stylesheet_directory_uri() ) . 'images/featured-image.png';
}
return $image;
}
add_filter('featured_image_column_default_image', 'my_custom_featured_image_column_image', 10, 2);
Remove support for post types Use the featured_image_column_init action hook for your filter.
function frosty_featured_image_column_init_func() {
add_filter('featured_image_column_post_types', 'frosty_featured_image_column_remove_post_types', 11); // Remove
}
add_action('featured_image_column_init', 'frosty_featured_image_column_init_func');
function frosty_featured_image_column_remove_post_types($post_types) {
foreach($post_types as $key => $post_type) {
if ($post_type === 'post-type') // Post type you'd like removed. Ex: 'post' or 'page'
unset($post_types[$key]);
}
return $post_types;
}
For more question please visit https://austin.passy.co
