hex value). * @var array $testimonials Raw testimonials array from post meta. * * Field reference — per testimonial item: * Required : name, role, text * Optional : image (avatar photo URL), company_logo (URL), rating (int 0–5) * * @package Aha_Orbit_Testimonials * @since 1.0.0 */ if (!defined('WPINC')) { die; } // This template owns its assets — only loaded when the Orbit (Default) layout is active. wp_enqueue_style( 'aha-orbit-testimonials-css' ); wp_enqueue_script( 'aha-orbit-testimonials-js' ); // ── Pre-check optional fields across all testimonials ───────────────────────── // Determines which optional card elements to render in HTML at all. // JavaScript will still show/hide them per slide via populateCardData(). $aha_orbit_has_image = false; $aha_orbit_has_rating = false; $aha_orbit_has_company_logo = false; if (is_array($testimonials)) { foreach ($testimonials as $aha_orbit_t) { if (!empty($aha_orbit_t['image'])) { $aha_orbit_has_image = true; } if (!empty($aha_orbit_t['rating']) && (float) $aha_orbit_t['rating'] > 0) { $aha_orbit_has_rating = true; } if (!empty($aha_orbit_t['company_logo'])) { $aha_orbit_has_company_logo = true; } // Stop early once all optional features are confirmed present. if ($aha_orbit_has_image && $aha_orbit_has_rating && $aha_orbit_has_company_logo) { break; } } } ?>