Added unused tag purging in post tag edit jobs

This commit is contained in:
Marcin Kurczewski 2014-05-03 22:53:55 +02:00
parent 425517f0ae
commit c3a20ad721
2 changed files with 2 additions and 0 deletions

View file

@ -11,6 +11,7 @@ class EditPostTagsJob extends AbstractPostJob
$newTags = array_map(function($tag) { return $tag->name; }, $post->getTags());
PostModel::save($post);
TagModel::removeUnused();
foreach (array_diff($oldTags, $newTags) as $tag)
{

View file

@ -30,6 +30,7 @@ class TogglePostTagJob extends AbstractPostJob
$post->setTags($tags);
PostModel::save($post);
TagModel::removeUnused();
if ($enable)
{