Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / menu_link_insert.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_insert.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_link_insert.twig
new file mode 100644 (file)
index 0000000..97764ea
--- /dev/null
@@ -0,0 +1,11 @@
+/**
+ * Implements hook_menu_link_insert().
+ */
+function {{ machine_name }}_menu_link_insert($link) {
+  // In our sample case, we track menu items as editing sections
+  // of the site. These are stored in our table as 'disabled' items.
+  $record['mlid'] = $link['mlid'];
+  $record['menu_name'] = $link['menu_name'];
+  $record['status'] = 0;
+  drupal_write_record('menu_example', $record);
+}