When getting the list of mail lists from mailpoet, I would like to be able to see if the list is visible to be managed.
The use case is to programmatically check if a user is subscribed to all of the lists that are manageable by them.
I have attached a patch that adds a 'display' attribute to the list array returned by getLists() that implements this feature. If you would kindly integrate it others could benefit and I wouldn't need to manage this patch myself.
diff --git a/mailpoet/lib/API/MP/v1/Segments.php b/mailpoet/lib/API/MP/v1/Segments.php
index f7ce734ea..ab59789e2 100644
--- a/mailpoet/lib/API/MP/v1/Segments.php
+++ b/mailpoet/lib/API/MP/v1/Segments.php
@@ -196,6 +196,7 @@ class Segments {
'created_at' => ($createdAt = $segment->getCreatedAt()) ? $createdAt->format(self::DATE_FORMAT) : null,
'updated_at' => $segment->getUpdatedAt()->format(self::DATE_FORMAT),
'deleted_at' => ($deletedAt = $segment->getDeletedAt()) ? $deletedAt->format(self::DATE_FORMAT) : null,
+ 'display' => $segment->getDisplayInManageSubscriptionPage(),
];
}
}