context['postId']; $product = wc_get_product( $post_id ); if ( ! $product || ! $product->get_review_count() ) { return ''; } $styles_and_classes = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes, array(), array( 'extra_classes' ) ); $text_align_styles_and_classes = StyleAttributesUtils::get_text_align_class_and_style( $attributes ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', array_filter( [ 'wc-block-components-product-average-rating-counter', esc_attr( $text_align_styles_and_classes['class'] ?? '' ), esc_attr( $styles_and_classes['classes'] ), ] ) ), 'style' => esc_attr( $styles_and_classes['styles'] ?? '' ), ) ); return sprintf( '