Fix latest coupon fetching logic

[MAILPOET-5169]
This commit is contained in:
Jan Jakes
2023-06-15 15:51:56 +02:00
committed by Aschepikov
parent 2c44192fa9
commit 54e6e11cf0

View File

@@ -214,7 +214,7 @@ class Helper {
public function getLatestCoupon(): ?string {
$coupons = $this->wp->getPosts([
'numberposts' => 1,
'orderby' => 'name',
'orderby' => 'date_created',
'order' => 'desc',
'post_type' => 'shop_coupon',
'post_status' => 'publish',