diff options
-rw-r--r-- | engine/lib/metadata.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 777d3b58e..7718907cf 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -238,7 +238,7 @@ * @param int $offset * @return array of ElggMetadata */ - function get_metadatas($object_id = 0, $object_type = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0) + function get_metadatas($object_id = 0, $object_type = "", $name = "", $value = "", $owner_id = 0, $order_by = "created desc", $limit = 10, $offset = 0) { global $CONFIG; @@ -264,6 +264,12 @@ if ($owner_id != 0) $where[] = "owner_id=$owner_id"; + if ($name != "") + $where[] = "name='$name'"; + + if ($value != "") + $where[] = "value='$value'"; + // add access controls $access = get_access_list(); $where[] = "(access_id in {$access} or (access_id = 0 and owner_id = {$_SESSION['id']}))"; |