diff --git a/functions.php b/functions.php index 32a5b2ec3..b67ff9570 100644 --- a/functions.php +++ b/functions.php @@ -6158,11 +6158,17 @@ $num_tags++; $tag_escaped = str_replace("'", "\\'", $tag); + if (mb_strlen($tag) > 30) { + $tag = truncate_string($tag, 30); + } + $tag_str = "$tag"; array_push($formatted_tags, $tag_str); + + $tmp_tags_str = implode(", ", $formatted_tags); - if ($num_tags == $tag_limit) { + if ($num_tags == $tag_limit || mb_strlen($tmp_tags_str) > 150) { break; } }