Skip to main content

benecaster_get_paid_tier_hierarchy()

Access Tier Free
benecaster_get_paid_tier_hierarchy( int $show_id ): array

Returns a show’s paid built-in tiers in the order Benecaster walks them when it picks which audio a listener hears: lowest first. A tier without its own audio variant hears the variant of the nearest lower tier in this list, or the base file.

It is the same list the feed, the download link and the website player use, so code that follows it cascades exactly as the audio a listener hears. Free tiers, inactive tiers and the Public tier are not in it.

Parameters

Name Type Default Required Description
$show_id int — Yes The show (post) ID.

Return Value

Type: string[]

The tier slugs of the show's active, paid built-in tiers, lowest first. [] for an unknown show and for a show connected to a membership plugin.

Example

$paid = benecaster_get_paid_tier_hierarchy( $show_id );
$lowest_paid = $paid[0] ?? null;

Notes

Rank tiers by their position in this list, never by a stored tier_order value, which can tie or leave gaps.

A show on a membership plugin returns []. It has no built-in tiers, so there is nothing to cascade through: a tier hears its own variant, or the base file.

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