mirror of
https://github.com/friendica/friendica
synced 2025-04-25 20:30:11 +00:00
Fix adding / removing photo tags + tagrm delete via GET + Item::update / add Term::deleteAllTags
This commit is contained in:
parent
dbfe5c9d2a
commit
fd2e06781d
5 changed files with 81 additions and 28 deletions
|
@ -290,4 +290,19 @@ class Term
|
|||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Deletes all Tags from an item
|
||||
*/
|
||||
public static function deleteAllTags($itemid)
|
||||
{
|
||||
$message = Item::selectFirst(['id'], ['id' => $itemid]);
|
||||
if (!DBA::isResult($message)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up all tags
|
||||
DBA::delete('term', ['otype' => TERM_OBJ_POST, 'oid' => $itemid, 'type' => [TERM_HASHTAG, TERM_MENTION]]);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue