✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.217.36
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/woocommerce/src/Internal/OrderReviews//StarRating.php
<?php
/**
 * StarRating control class file.
 */

declare( strict_types = 1 );

namespace Automattic\WooCommerce\Internal\OrderReviews;

/**
 * Server-side renderer for the accessible 5-star rating control used on the
 * Review Order page.
 *
 * The control degrades to native `<input type="radio">` elements without
 * JavaScript and is enhanced by `client/legacy/js/frontend/order-review.js`
 * for keyboard navigation, a visible focus ring, and the dynamic caption
 * underneath the stars.
 *
 * @internal Just for internal use.
 *
 * @since 10.8.0
 */
class StarRating {

	/**
	 * Render the rating control. Returns the HTML; does not echo.
	 *
	 * Required keys in `$args`:
	 *  - `name` (string): form field name (one per item).
	 *  - `id_prefix` (string): prefix used to build unique radio ids.
	 *  - `label_id` (string): id of the existing label element that describes
	 *    the group via `aria-labelledby`.
	 *
	 * Optional:
	 *  - `selected` (int): pre-selected value 0-5; pass `0` (the default)
	 *    for no pre-selection. Values outside 0-5 are treated as no selection.
	 *
	 * @since 10.8.0
	 *
	 * @param array $args Render arguments. See description for required and optional keys.
	 * @return string
	 */
	public static function render( array $args ): string {
		$name      = (string) ( $args['name'] ?? '' );
		$id_prefix = (string) ( $args['id_prefix'] ?? '' );
		$label_id  = (string) ( $args['label_id'] ?? '' );

		if ( '' === $name || '' === $id_prefix || '' === $label_id ) {
			return '';
		}

		$selected = (int) ( $args['selected'] ?? 0 );
		if ( $selected < 0 || $selected > 5 ) {
			$selected = 0;
		}

		ob_start();
		wc_get_template(
			'order/star-rating.php',
			array(
				'name'      => $name,
				'id_prefix' => $id_prefix,
				'label_id'  => $label_id,
				'selected'  => $selected,
				'labels'    => self::get_labels(),
			)
		);
		return (string) ob_get_clean();
	}

	/**
	 * Default rating labels, indexed 1-5, after the customer-facing filter.
	 *
	 * Defaults match the long-standing WooCommerce product-review labels in
	 * `templates/single-product-reviews.php` so customers see consistent
	 * wording across the two review entry points.
	 *
	 * @since 10.8.0
	 *
	 * @return array<int, string>
	 */
	public static function get_labels(): array {
		$labels = array(
			1 => __( 'Very poor', 'woocommerce' ),
			2 => __( 'Not that bad', 'woocommerce' ),
			3 => __( 'Average', 'woocommerce' ),
			4 => __( 'Good', 'woocommerce' ),
			5 => __( 'Perfect', 'woocommerce' ),
		);

		/**
		 * Filter the labels shown under the star-rating control.
		 *
		 * @since 10.8.0
		 *
		 * @param array<int, string> $labels Map of rating value (1-5) to label.
		 */
		$filtered = (array) apply_filters( 'woocommerce_review_order_rating_labels', $labels );

		// Keep only known 1-5 keys; fall back to defaults for any the filter dropped.
		return array_replace( $labels, array_intersect_key( $filtered, $labels ) );
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 May 2026 10.38 AM
tdhomesa / tdhomesa
0755
Endpoint.php
27.62 KB
25 May 2026 2.01 PM
tdhomesa / tdhomesa
0644
ItemEligibility.php
9.636 KB
25 May 2026 2.01 PM
tdhomesa / tdhomesa
0644
Meta.php
1.337 KB
25 May 2026 2.01 PM
tdhomesa / tdhomesa
0644
Scheduler.php
7.296 KB
25 May 2026 2.01 PM
tdhomesa / tdhomesa
0644
StarRating.php
2.884 KB
11 May 2026 5.17 PM
tdhomesa / tdhomesa
0644
SubmissionHandler.php
13.648 KB
25 May 2026 2.01 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF