aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index f5498ac8b..1d229eea3 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1394,6 +1394,36 @@ DELETE
);
}
+/**
+ *
+ */
+function delete_tags($tag_ids)
+{
+ if (is_numeric($tag_ids))
+ {
+ $tag_ids = array($tag_ids);
+ }
+
+ if (!is_array($tag_ids))
+ {
+ return false;
+ }
+
+ $query = '
+DELETE
+ FROM '.IMAGE_TAG_TABLE.'
+ WHERE tag_id IN ('.implode(',', $tag_ids).')
+;';
+ pwg_query($query);
+
+ $query = '
+DELETE
+ FROM '.TAGS_TABLE.'
+ WHERE id IN ('.implode(',', $tag_ids).')
+;';
+ pwg_query($query);
+}
+
function tag_id_from_tag_name($tag_name)
{
global $page;