<?php

if ( ! defined( 'ABSPATH' ) ) { return; }
if ( ! function_exists( 'is_singular' ) || ! is_singular( 'product' ) ) { return; }
if ( ! class_exists( 'AIEO_DMM_Custom_Slots' ) ) { return; }

$slots = AIEO_DMM_Custom_Slots::get_all_slots();
if ( empty( $slots ) ) { return; }

$out = '';
foreach ( $slots as $slot ) {
    if ( empty( $slot['enabled'] ) ) { continue; }
    $html = AIEO_DMM_Custom_Slots::render_slot( (string) $slot['id'] );
    if ( $html === '' ) { continue; }
    
    
    
    
    
    
    
    
    
    $slot_id_clean = esc_attr( sanitize_html_class( (string) $slot['id'] ) );
    $out .= sprintf(
        '<section class="aieo-custom-slot aieo-custom-slot--%1$s aieo-recommendations" data-aieo-reco="%1$s" data-section="%1$s">%2$s</section>',
        $slot_id_clean,
        $html 
    );
}

echo $out;
