您可以筛选\'get_comment_author_IP\'
:
add_filter( \'get_comment_author_IP\', \'wpse_77254_trim_comment_ip\' );
function wpse_77254_trim_comment_ip( $ip )
{
return implode( \'.\', array_slice(explode( \'.\', $ip ), 2) ) . \'…\';
}
注意,此操作将失败
IPv6 addresses.