在woocommerce中以其他格式显示评论评级(仅数字)
我只想在评论列表B中显示评论评级的数量,使用此功能在评论列表中显示评论评级:在woocommerce中以其他格式显示评论评级(仅数字),woocommerce,rating,Woocommerce,Rating,我只想在评论列表B中显示评论评级的数量,使用此功能在评论列表中显示评论评级: function wc_get_star_rating_html( $rating, $count = 0 ) { $html = '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%">'; if ( 0 < $count ) { /* translators: 1: rating 2: rating coun
function wc_get_star_rating_html( $rating, $count = 0 ) {
$html = '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%">';
if ( 0 < $count ) {
/* translators: 1: rating 2: rating count */
$html .= sprintf( _n( 'Rated %1$s out of 5 based on %2$s customer rating', 'Rated %1$s out of 5 based on %2$s customer ratings', $count, 'woocommerce' ), '<strong class="rating">' . esc_html( $rating ) . '</strong>', '<span class="rating">' . esc_html( $count ) . '</span>' );
} else {
/* translators: %s: rating */
$html .= sprintf( esc_html__( 'Rated %s out of 5', 'woocommerce' ), '<strong class="rating">' . esc_html( $rating ) . '</strong>' );
}
$html .= '</span>';
return apply_filters( 'woocommerce_get_star_rating_html', $html, $rating, $count );
}
函数wc\u get\u star\u rating\u html($rating,$count=0){
$html='';
如果(0<$count){
/*翻译:1:评分2:评分计数*/
$html.=sprintf(_n(‘根据%2$s客户评级,五分之一评级’,‘根据%2$s客户评级,五分之一评级’,$count,'woocommerce'),‘'.esc_html($rating)。‘’,‘.esc_html($count)。’;
}否则{
/*转换器:%s:分级*/
$html.=sprintf(esc_html_uuuuuuuuuuuuuuuuuuuuuuuuuuuuu('Rated%s of 5','woocommerce'),''.esc_html('rating');
}
$html.='';
返回apply_筛选器('woocommerce_get_star_rating_html'、$html、$rating、$count);
}
现在,当选择的比率然后在评论列表中发送评论时,我想只显示用户评分的数量
例如:当选择三星时,提交评论,然后在评论列表中显示三星文本,就像您选择三星一样。每个人都可以帮助会议每个人都可以帮助我