public function modules_drop_down_html($course_id = 0) { //$course_id = 211; $html = ''; if (0 < intval($course_id)) { $modules = new Sensei_Core_Modules(); $course_modules = $modules->get_course_modules($course_id); //$html .= print_r($course_modules, true); $html .= '<option value="">' . __('Select a module', 'woothemes-sensei') . '</option>'; if (count($course_modules) > 0) { foreach ($course_modules as $cm) { $html .= '<option value="' . $cm->term_id . '">' . $cm->name . '</option>' . "\n"; } // End For Loop } // End If Statement } // End If Statement return $html; }