Skip to content

Commit

Permalink
fix: Fixed an issue where the **Truncate Description Tags** toggle di…
Browse files Browse the repository at this point in the history
…d not work as expected ([#1386](#1386))
  • Loading branch information
khalwat committed Nov 23, 2023
1 parent 94244c9 commit e5e102e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/models/metatag/DescriptionTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

namespace nystudio107\seomatic\models\metatag;

use nystudio107\seomatic\Seomatic;
use nystudio107\seomatic\helpers\Text as TextHelper;
use nystudio107\seomatic\models\MetaTag;
use nystudio107\seomatic\Seomatic;

/**
* @author nystudio107
Expand Down Expand Up @@ -67,7 +67,7 @@ public function prepForRender(&$data): bool
if ($shouldRender) {
if (!empty($data['content'])) {
// Truncate the Description tag content
if (Seomatic::$settings->truncateTitleTags) {
if (Seomatic::$settings->truncateDescriptionTags) {
$data['content'] = TextHelper::truncateOnWord(
$data['content'],
Seomatic::$settings->maxDescriptionLength,
Expand Down
6 changes: 3 additions & 3 deletions src/models/metatag/OgDescriptionTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

namespace nystudio107\seomatic\models\metatag;

use nystudio107\seomatic\Seomatic;
use nystudio107\seomatic\helpers\Text as TextHelper;
use nystudio107\seomatic\models\MetaTag;
use nystudio107\seomatic\Seomatic;

/**
* @author nystudio107
Expand Down Expand Up @@ -67,10 +67,10 @@ public function prepForRender(&$data): bool
if ($shouldRender) {
if (!empty($data['content'])) {
// Truncate the Description tag content
if (Seomatic::$settings->truncateTitleTags) {
if (Seomatic::$settings->truncateDescriptionTags) {
$data['content'] = TextHelper::truncateOnWord(
$data['content'],
300,
Seomatic::$settings->maxDescriptionLength,
'…'
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/models/metatag/TwitterDescriptionTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

namespace nystudio107\seomatic\models\metatag;

use nystudio107\seomatic\Seomatic;
use nystudio107\seomatic\helpers\Text as TextHelper;
use nystudio107\seomatic\models\MetaTag;
use nystudio107\seomatic\Seomatic;

/**
* @author nystudio107
Expand Down Expand Up @@ -67,10 +67,10 @@ public function prepForRender(&$data): bool
if ($shouldRender) {
if (!empty($data['content'])) {
// Truncate the Description tag content
if (Seomatic::$settings->truncateTitleTags) {
if (Seomatic::$settings->truncateDescriptionTags) {
$data['content'] = TextHelper::truncateOnWord(
$data['content'],
300,
Seomatic::$settings->maxDescriptionLength,
'…'
);
}
Expand Down

0 comments on commit e5e102e

Please sign in to comment.