public static function course_created(\core\event\course_created $event) {
        global $CFG;

        $course = $event->get_record_snapshot('course', $event->objectid);
        $format = course_get_format($course);
        if ($format->supports_news() && !empty($course->newsitems)) {
            require_once($CFG->dirroot . '/mod/forum/lib.php');
            // Auto create the announcements forum.
            forum_get_course_forum($event->objectid, 'news');
        }
    }