/** * Force ThemeComplete EPO assets to enqueue on single product pages. * Also useful if an optimizer or template prevented normal enqueue. */ add_action('wp_enqueue_scripts', function () { if (function_exists('is_product') && !is_product()) return; global $wp_scripts, $wp_styles; // Enqueue any registered scripts that look like EPO if ($wp_scripts && !empty($wp_scripts->registered)) { foreach ($wp_scripts->registered as $handle => $obj) { if (preg_match('/(epo|extra-product-options|themecomplete)/i', $handle)) { wp_enqueue_script($handle); } } } // Enqueue any registered styles that look like EPO if ($wp_styles && !empty($wp_styles->registered)) { foreach ($wp_styles->registered as $handle => $obj) { if (preg_match('/(epo|extra-product-options|themecomplete)/i', $handle)) { wp_enqueue_style($handle); } } } }, 100);