Automattic\WooCommerce\Blocks\BlockTypes
ProductRating::filter_rating_html()
Filter the output from wc_get_rating_html.
Метод класса: ProductRating{}
Хуков нет.
Возвращает
Строку
.
Использование
$ProductRating = new ProductRating(); $ProductRating->filter_rating_html( $html, $rating, $count );
- $html(строка) (обязательный)
- Star rating markup.
По умолчанию: empty string - $rating(float) (обязательный)
- Rating being shown.
- $count(int) (обязательный)
- Total number of ratings.
Код ProductRating::filter_rating_html() ProductRating::filter rating html WC 7.3.0
public function filter_rating_html( $html, $rating, $count ) { if ( 0 < $rating ) { /* translators: %s: rating */ $label = sprintf( __( 'Rated %s out of 5', 'woocommerce' ), $rating ); $html = '<div class="wc-block-components-product-rating__stars wc-block-grid__product-rating__stars" role="img" aria-label="' . esc_attr( $label ) . '">' . wc_get_star_rating_html( $rating, $count ) . '</div>'; } return $html; }