benecaster_get_broadcasts()
benecaster_get_broadcasts( int $show_id, array $args = [] ): array
One show’s broadcasts, including a broadcast nobody was mailed. An export’s date_start and date_end can be passed as they are. See Add a show’s email opt-outs and broadcast history to the data export.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
show_id |
int |
— | Yes | The show whose broadcasts to read. |
args |
array |
[] |
No | Optional date_from and date_to, compared against when the broadcast was sent (UTC, inclusive, Y-m-d for the whole day or Y-m-d H:i:s). Missing or empty sets no limit. |
Return Value
Type:
array
One row per broadcast, newest first and unpaged: id, show_id, subject, preheader, audiences, author_id, created_at and completed_at (UTC), recipients, suppressed, skipped, total, sent, failed, pending, body_purged, status. No message body. A malformed date returns [] and raises _doing_it_wrong().
Example
$broadcasts = benecaster_get_broadcasts( $show_id, [
'date_from' => '2026-01-01',
'date_to' => '2026-01-31',
] );
Notes
There is no capability check: check manage_options, or your own capability, before showing the rows.
Need this built rather than just documented? See our services →