media - adding images column to admin edit columns not working for SVG

I added the ability to use SVG as graphics on my site.They are showing up fine on the front end, but I'm having 2

I added the ability to use SVG as graphics on my site. They are showing up fine on the front end, but I'm having 2 issues on the backend.

The problem is that I want to show post thumbnails on the admin backend. Png and jpg work fine with this code:

//adds thumbs to admin edit columns for posts and CPTs
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);

function posts_columns($defaults){
    $defaults['rt_post_thumbs'] = __('Thumbs');
    return $defaults;
}

function posts_custom_columns($column_name, $id){
    if($column_name === 'rt_post_thumbs'){
        echo the_post_thumbnail( array(50,50) );
    }
}

However when I add an SVG to a featured image, no matter what I do for echoing the size (3rd to last line above) the svg renders at full size. Other graphics respect my size restrictions. Is there a way to constrain the SVG as well?

Additionally the SVG doesn't always show up in the post edit section under the featured image section, (it just shows as a blank area) but I'm not nearly as worried about that.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744923334a4601271.html

相关推荐

  • media - adding images column to admin edit columns not working for SVG

    I added the ability to use SVG as graphics on my site.They are showing up fine on the front end, but I'm having 2

    2天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信