From c9d4cf5b0b0f5ad3056cd4d6dc744a8b4890fb4e Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 14 Feb 2011 03:40:59 +0000 Subject: Updated trunk to use new annotation functions. Added checks for annotations_* options vs annotation_* options because it's so easy to confuse. git-svn-id: http://code.elgg.org/elgg/trunk@8223 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/metadata.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'engine/lib/metadata.php') diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 08c87ae67..c05e0b161 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -32,7 +32,21 @@ function row_to_elggmetadata($row) { * @return false|ElggMetadata */ function elgg_get_metadata_from_id($id) { - return elgg_get_metastring_based_object_by_id($id, 'metadata'); + return elgg_get_metastring_based_object_from_id($id, 'metadata'); +} + +/** + * Deletes metadata using its ID. + * + * @param int $id The metadata ID to delete. + * @return bool + */ +function elgg_delete_metadata_by_id($id) { + $metadata = elgg_get_metadata_from_id($id); + if (!$metadata) { + return false; + } + return $metadata->delete(); } /** -- cgit v1.2.3