From 4990faf1ebf89b8f6bda96580fede8d9b17e8872 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 2 Dec 2010 11:54:15 +0000 Subject: added a function for getting current site entity git-svn-id: http://code.elgg.org/elgg/trunk@7495 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sites.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'engine/lib/sites.php') 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 @@ -7,6 +7,24 @@ * @subpackage DataModel.Site */ +/** + * 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. * -- cgit v1.2.3