【发布时间】:2014-11-18 13:38:10
【问题描述】:
为什么我的functions.php中的这个过滤器对cmets中的get_avatar()函数不起作用?
// Remove height/width attributes on avatar img tags.
function myscript_remove_dimensions_avatars( $avatar ) {
$avatar = preg_replace( '/(width|height)=\"\d*\"\s/', "", $avatar );
return $avatar;
}
add_filter( 'get_avatar', 'myscript_remove_dimensions_avatars', 10 );
.
在我的 cmets 模板中,我使用这个 PHP 标签来打印(gr)头像。
<?php echo get_avatar( $comment, 96 ); ?>
【问题讨论】:
标签: php wordpress add-filter