PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 All 51 releases
← All changes | app/Services/Renderer/ReviewThreadMarkup.php +18 -1 1.7.0 → 1.7.1 View file →
@@ -432,9 +432,26 @@
432 432 {
433 433 return '<svg class="fct-review-reply-icon" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg>';
434 434 }
435 435
436 + /**
437 + * The star every rating on the storefront is drawn with.
438 + *
439 + * The shape lives in app/Views/icons/review-star.svg, which the admin,
440 + * block editor and customer portal import too, so there is one star to
441 + * change. A replacement passed through the filter should keep the
442 + * fct-star-svg class, fill="currentColor" and the 1em size: the star
443 + * colours, half-star clipping and sizing all hang off those.
444 + *
445 + * @return string
446 + */
436 447 public static function starSvg(): string
437 448 {
438 - return '<svg class="fct-star-svg" width="1em" height="1em" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 2.25l2.955 6.377 6.98.638-5.268 4.62 1.558 6.865L12 17.155 5.775 20.75l1.558-6.865-5.268-4.62 6.98-.638L12 2.25z"/></svg>';
449 + static $svg = null;
450 +
451 + if ($svg === null) {
452 + $svg = trim((string) file_get_contents(FLUENTCART_PLUGIN_PATH . 'app/Views/icons/review-star.svg'));
453 + }
454 +
455 + return (string) apply_filters('fluent_cart/reviews/star_svg', $svg);
439 456 }
440 457 }