function course_instructor_popup_shortcode($atts) {
$atts = shortcode_atts([
\’id\’ => null,
], $atts);
$post_id = $atts[\’id\’] ? intval($atts[\’id\’]) : get_the_ID();
if (!$post_id || get_post_type($post_id) !== \’course\’) {
return \’\’;
}
$instructor = get_field(\’instructor\’, $post_id);
$bio = get_field(\’instructor_bio\’, $post_id);
if (!$instructor || !$bio) return \’\’;
// Ensure unique ID for multiple modals
$unique_id = \’instructorModal_\’ . $post_id;
ob_start();
?>
\” class=\”instructor-modal-overlay\” onclick=\”if(event.target === this) this.style.display=\’none\’\”>