Skip to main content

benecaster_feed_request_rollup_completed

Action Free

Fires after each nightly rollup pass completes. The rollup runs at 02:15 site time and condenses the previous day’s raw feed-poll records into per-day totals; this action fires once for every date it processes.

Parameters

Name Type Default Description
$result array — Rollup result. Keys: `date` (string 'Y-m-d' — the calendar date that was rolled up), `rows_written` (int — number of aggregate rows inserted or updated in benecaster_feed_request_daily for this date)

Examples

Trigger a downstream aggregation job when the nightly rollup completes

add_action( 'benecaster_feed_request_rollup_completed', function ( array $result ): void {
    // Push yesterday's aggregate data to an external warehouse
    wp_remote_post( MY_WAREHOUSE_ENDPOINT, [
        'body' => wp_json_encode( [
            'date'         => $result['date'],
            'rows_written' => $result['rows_written'],
            'source'       => home_url(),
        ] ),
    ] );
} );

Notes

This action fires once per rollup date. When the "Rebuild aggregate from raw" tool is used, it fires once for each historical date reprocessed. Guard against duplicate downstream writes if your consumer is not idempotent. Prefer this hook to a fixed schedule: cron time drifts with site traffic, so a scheduled reader will sometimes pick up yesterday's numbers.

Need this built rather than just documented? See our services →