You would call the add_instance method of the course meta link plugin. For an example, beginning around line 2154, look at:
https://github.com/appalachianstate/moodle-enrol_shebang/blob/master/locallib.php
You would call the add_instance method of the course meta link plugin. For an example, beginning around line 2154, look at:
https://github.com/appalachianstate/moodle-enrol_shebang/blob/master/locallib.php