Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / menu_contextual_links_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_contextual_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/menu_contextual_links_alter.twig
new file mode 100644 (file)
index 0000000..21c365e
--- /dev/null
@@ -0,0 +1,17 @@
+/**
+ * Implements hook_menu_contextual_links_alter().
+ */
+function {{ machine_name }}_menu_contextual_links_alter(&$links, $router_item, $root_path) {
+  // Add a link to all contextual links for nodes.
+  if ($root_path == 'node/%') {
+    $links['foo'] = array(
+      'title' => t('Do fu'),
+      'href' => 'foo/do',
+      'localized_options' => array(
+        'query' => array(
+          'foo' => 'bar',
+        ),
+      ),
+    );
+  }
+}