Skip to content
Corex

WpEmailStudioStore

Corex\Email\Studio\WpEmailStudioStore · class · Add-ons layer

Private WordPress persistence for Email Studio assets and immutable events. WordPress takes one level of slashes off a post’s title and off a meta value on their way in, so each is handed over with one put on: a record is read back as the text it was given, a path or a CSS escape in it included.

create(string $type, string $slug, string $name, int $parentId, array $payload): int

Section titled “create(string $type, string $slug, string $name, int $parentId, array $payload): int”

update(int $id, string $name, array $payload): bool

Section titled “update(int $id, string $name, array $payload): bool”

pruneOlderThan(string $type, DateTimeImmutable $cutoff, int $limit): int

Section titled “pruneOlderThan(string $type, DateTimeImmutable $cutoff, int $limit): int”

findBySlug(string $type, string $slug): ?array

Section titled “findBySlug(string $type, string $slug): ?array”

Read newest first. all() reads the first 500 a kind ever had, which is every record on most sites and, on a busy one, none of the recent ones.