不确定它将如何处理Disqus,但请尝试以下筛选器:
add_filter( \'comments_number\', \'comments_text_wpse_87886\', 10, 2 );
function comments_text_wpse_87886 ( $output, $number )
{
return $number;
}
原始申报表为
$output
, 相反,我们只返回评论的数量。该过滤器发生在以下情况
core function, 如果要调整之前的过滤器挂钩,请在此复制:
function comments_number( $zero = false, $one = false, $more = false, $deprecated = \'\' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, \'1.3\' );
$number = get_comments_number();
if ( $number > 1 )
$output = str_replace(\'%\', number_format_i18n($number), ( false === $more ) ? __(\'% Comments\') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __(\'No Comments\') : $zero;
else // must be one
$output = ( false === $one ) ? __(\'1 Comment\') : $one;
echo apply_filters(\'comments_number\', $output, $number);
}
相关:
Where to put my code: plugin or functions.php?