Skip to main content

benecaster_show_deleted

Action Free

Fires before a show is permanently deleted, by every route: the Shows screen, DELETE /shows/{id}, wp-admin’s Delete Permanently, and wp_delete_post() from code or WP-CLI. Use it to clean up related data in your own tables or in external systems.

Everything the show owns is still readable when this fires: get_post(), get_post_meta() and get_the_title() return valid data, and so do its episodes, tokens and tiers. Benecaster removes the show’s content and setup afterwards, in the same request: its episodes (each one firing benecaster_episode_deleted), tokens, tier mappings, built-in membership tiers and buy-ups, reference library (each item firing benecaster_reference_library_item_deleted), episode types and its license connection. Then WordPress removes the post row. The show’s records stay: payments, donations, unsubscribe and email logs, and analytics history.

A show that anyone is subscribed to (any active token, followers included) cannot be deleted by any route, and this hook does not fire for it: DELETE /shows/{id} answers 409 show_has_subscribers, and wp_delete_post() returns false. Moving a show to the trash fires benecaster_show_trashed instead.

Parameters

Name Type Default Description
$show_id int — ID of the show about to be deleted

Examples

Delete show record from external CRM

add_action( 'benecaster_show_deleted', function ( int $show_id ) {
    my_crm_delete_show( $show_id );
} );

Notes

Benecaster's own cleanup runs after this hook, at a later priority on the same WordPress deletion action, so a listener at the default priority sees the show whole. Your add-on's per-show rows are not removed for you — delete them here; see the recipe cleanup-on-show-delete. For reversible deactivation, hook benecaster_show_trashed instead.

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