Skip to content

Commit a9590aa

Browse files
committed
fix: shorten text when too long
1 parent c004611 commit a9590aa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/ExternalPostSender.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@ public function __construct(
3737
}
3838
}
3939

40-
public function getTextFieldContent($page, $trimTextPosition) {
41-
if(is_array($this->textfields)) {
42-
foreach($this->textfields as $field) {
43-
if($page->$field()->exists() && $page->$field()->isNotEmpty()) {
44-
return $page->$field()->value();
40+
public function getTextFieldContent($page, $trimTextPosition)
41+
{
42+
if (is_array($this->textfields)) {
43+
foreach ($this->textfields as $field) {
44+
if ($page->$field()->exists() && $page->$field()->isNotEmpty()) {
45+
return Str::short($page->$field()->value(), $trimTextPosition);
4546
}
4647
}
4748
}
4849

4950
$field = $this->textfields;
50-
if(!is_array($this->textfields) && $page->$field()->isNotEmpty()) {
51-
return $page->$field()->value();
51+
if (!is_array($this->textfields) && $page->$field()->isNotEmpty()) {
52+
return Str::short($page->$field()->value(), $trimTextPosition);
5253
}
5354

5455
return Str::short($page->title(), $trimTextPosition);

0 commit comments

Comments
 (0)