Skip to content

Commit

Permalink
Added additional fallback for description
Browse files Browse the repository at this point in the history
  • Loading branch information
jponsen committed Dec 20, 2023
1 parent a16c94b commit 5c0f838
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Rest/Routes/Watches.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public function watches(): array
} else {
$description = !empty($meta['_wristler_description'][0])
? $meta['_wristler_description'][0]
: $name;
: $watch->post_content;

if(empty($description)) {
$description = $name;
}
}

$priceOnRequest = empty($product->get_price());
Expand Down Expand Up @@ -96,6 +100,8 @@ public function watches(): array
return [];
}

// 'description' => trim(preg_replace('#\[[^\]]+\]#', '', wp_strip_all_tags($description))),

return [
'ID' => $watch->ID,
'reference' => trim($meta['_wristler_reference'][0]) ?? null,
Expand Down

0 comments on commit 5c0f838

Please sign in to comment.