Skip to content

Instantly share code, notes, and snippets.

@Gang-Peng
Created December 26, 2014 06:13
Show Gist options
  • Select an option

  • Save Gang-Peng/71f34b1f6b642555a7bd to your computer and use it in GitHub Desktop.

Select an option

Save Gang-Peng/71f34b1f6b642555a7bd to your computer and use it in GitHub Desktop.
code example of adding new function into elgg REST API interfaces in 1.8.19 version of elgg
diff --git a/elgg-1.8.19/engine/lib/web_services.php b/elgg-1.8.19/engine/lib/web_services.php
index 51cad6f..d66e16a 100644
--- a/elgg-1.8.19/engine/lib/web_services.php
+++ b/elgg-1.8.19/engine/lib/web_services.php
@@ -1448,7 +1448,22 @@ function api_init() {
false,
false
);
// test
expose_function("test.echo",
"my_echo",
array("string" => array('type' => 'string')),
'A testing method which echos back a string',
'GET',
false,
false
);
}
function my_echo($string) {
return $string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment