Skip to main content

Show the podcaster’s inactivity threshold in your add-on, read-only, with a link to change it

Free Beginner

The Feed inactivity threshold is a per-show setting (Show Settings → Subscription → Subscriber Engagement). An add-on that acts on benecaster_subscriber_feed_inactive should say what that number is, and point at the one place it is set, rather than offering its own copy that would silently disagree. benecaster_get_engagement_threshold() returns it.

Code

<?php
$days = benecaster_get_engagement_threshold( $show_id ); // includes any filter

printf(
    '<p>%s <a href="%s">%s</a></p>',
    esc_html( sprintf(
        /* translators: %d: number of days */
        _n( 'Listeners are tagged inactive after %d day without checking the feed.', 'Listeners are tagged inactive after %d days without checking the feed.', $days, 'my-addon' ),
        $days
    ) ),
    esc_url( admin_url( 'admin.php?page=benecaster#/shows/' . $show_id . '/settings/subscription' ) ),
    esc_html__( 'Change it in Show Settings', 'my-addon' )
);

View on GitHub →

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