benecaster_get_engagement_threshold()
benecaster_get_engagement_threshold( int $show_id ): int
Returns the inactivity threshold the daily engagement check applies to a show — the point at which benecaster_subscriber_feed_inactive fires. Because it applies the benecaster_subscriber_engagement_threshold filter, what your add-on displays is what actually happens.
Display it read-only and link to Show Settings; never keep a copy. The threshold is one per-show setting the podcaster owns. An add-on that offers its own copy will silently disagree with it the first time the podcaster changes the setting.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
show_id |
int |
— | Yes | The show whose threshold to read. |
Return Value
Type:
int
The number of days without a feed poll after which a listener on this show counts as inactive — at least 1. The show's Feed inactivity threshold from Show Settings → Subscription (default 30, 1 to 365), with the benecaster_subscriber_engagement_threshold filter applied.
Example
printf(
/* translators: %d: number of days */
esc_html__( 'Listeners who have not checked the feed for %d days are tagged inactive.', 'my-addon' ),
benecaster_get_engagement_threshold( $show_id )
);
Hooks Fired
Notes
Read it each time you need it — the podcaster can change it at any moment, and the daily check reads the live value. Worked example: the recipe Show the inactivity threshold in your add-on.
Need this built rather than just documented? See our services →