Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / xmlrpc_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/xmlrpc_alter.twig
new file mode 100644 (file)
index 0000000..8896c13
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * Implements hook_xmlrpc_alter().
+ */
+function {{ machine_name }}_xmlrpc_alter(&$methods) {
+  // Directly change a simple method.
+  $methods['drupal.login'] = 'mymodule_login';
+
+  // Alter complex definitions.
+  foreach ($methods as $key => &$method) {
+    // Skip simple method definitions.
+    if (!is_int($key)) {
+      continue;
+    }
+    // Perform the wanted manipulation.
+    if ($method[0] == 'drupal.site.ping') {
+      $method[1] = 'mymodule_directory_ping';
+    }
+  }
+}