aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/sites.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index a348d166b..97398d7f2 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -8,6 +8,24 @@
*/
/**
+ * Get an ElggSite entity (default is current site)
+ *
+ * @param int $site_guid Optional. Site GUID.
+ *
+ * @return ElggSite
+ * @since 1.8.0
+ */
+function elgg_get_site_entity($site_guid = 0) {
+ global $CONFIG;
+
+ if ($site_guid == 0) {
+ return $CONFIG->site;
+ }
+
+ return get_entity($site_guid);
+}
+
+/**
* Return the site specific details of a site by a row.
*
* @param int $guid The site GUID