benecaster_pricing_table_output
Filters the complete HTML output of benecaster_pricing_table. $tiers contains only the tiers rendered (after exclude is applied). Use to inject feature list rows between tier columns, add a custom CTA variant, or replace the table structure entirely.
Return the complete HTML string for the shortcode. Cast with (string).
This value becomes the shortcode’s return value and is not escaped by Benecaster — WordPress emits it as the shortcode’s output. Escape every dynamic part yourself; this is the filter to be careful with, not the display-side ones that run through esc_html().
Returning '' makes the shortcode render nothing at all, which is the supported way to suppress it conditionally. The $atts parameter is the shortcode’s resolved attributes, so a callback can scope itself to one usage rather than every instance on the site.
Free tiers are in $tiers. Each tier carries is_free — true for a built-in tier marked free or a public tier on a membership plugin. Branch on is_free, never on price: a free built-in tier’s price is 0.0 and a public membership-plugin tier’s is usually null, so a price check prints a bare 0 or Price unavailable for a tier that is simply free. A callback that rebuilds the table on the assumption that every tier is paid needs that check.
Format price with the tier’s currency, never a fixed symbol. A built-in tier can be priced in any currency, so a callback that prints a dollar sign shows the wrong amount to a podcaster who prices in euros. On a membership-plugin show currency is null: the plugin formats its own prices, so leave those cells as Benecaster rendered them.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$output |
string |
— | Rendered HTML |
$tiers |
array |
— | The tier rows rendered, in order, after excluded tiers are removed. Free tiers are included. Each is an object with `slug`, `name`, `price` (float in major units of `currency`, or null when the plan has no price), `currency` (the ISO code of the built-in price row `price` comes from, the tier's default billing period; null on a membership-plugin show and on a tier with no price), `external_tier_id` (the membership plugin's ID; an empty string on a built-in-membership show) and `is_free` (bool). |
$show_id |
int |
— | ID of the show |
$atts |
array |
— | Resolved shortcode attributes |
Returns:
string
Example
add_filter( 'benecaster_pricing_table_output', function( $output, $tiers, $show_id, $atts ) {
// Under the table, point at the free tier if the table lists one.
foreach ( $tiers as $tier ) {
if ( $tier->is_free ) {
$output .= '<p class="my-free-tier-note">'
. esc_html( sprintf( 'Not ready to pay? %s is free.', $tier->name ) )
. '</p>';
break;
}
}
return $output;
}, 10, 4 );
Need this built rather than just documented? See our services →