Skip to main content

benecaster_analytics_subscriber_count

Filter Free

Filters the value returned by benecaster_get_subscriber_count() — the active-token count for one show. Use it to adjust a displayed audience figure: to fold in listeners tracked somewhere else, or to leave the podcaster’s own comp tokens out of a public “N subscribers” line.

This affects display only, and cannot reach a billing decision. Nothing in core calls benecaster_get_subscriber_count(), so what you return here is seen by the calling code and nothing else. It does not touch your plan limit, the over-limit threshold, the upgrade notices, or what the licence server is told — all of those come from a separate paying-only count read straight from the database.

The filtered number is not a paying-subscriber count to begin with. The underlying figure is every active token for the show, followers and free-tier bridge members included. Adjusting it does not turn it into a paying count. See Which subscriber count is the paying one.

The hook name is misleading and is kept only because it is a published contract. Despite it, this filter has nothing to do with the Analytics Dashboard add-on and drives no licence tier threshold — it is applied in core, with no add-on gate, and reaches no threshold.

Parameters

Name Type Default Description
$count int Active token count read from the database.
$show_id int ID of the show.

Returns: int

Example

add_filter( 'benecaster_analytics_subscriber_count', function( $count, $show_id ) {
    // Add listeners we track elsewhere to the figure this show displays.
    if ( (int) $show_id === 42 ) {
        $extra = (int) get_post_meta( $show_id, '_offline_subscriber_count', true );
        $count += $extra;
    }
    return $count;
}, 10, 2 );

Notes

Return an int. A non-numeric return is cast, so a callback that accidentally returns null or a string reports zero rather than failing visibly.

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