Skip to main content

benecaster_credit_before_stamp

Filter Free Since v1.0.0

Filters the raw credit template body immediately BEFORE do_shortcode() runs, so the value returned by this filter is what gets shortcode-resolved and frozen onto the episode’s _benecaster_stamped_credit post meta. Use to inject external data (sponsor copy, promo codes, affiliate links, per-episode dynamic content) into the stamped output — injected content may itself contain shortcodes and will be resolved along with the template body.

Parameters

Name Type Default Description
$body string Raw template body as stored on the show, before shortcode resolution
$episode_id int ID of the episode being stamped
$credit_id string UUID of the show-level credit template being applied
$show \WP_Post Parent show post object

Returns: string

Example

add_filter( 'benecaster_credit_before_stamp', function( string $body, int $episode_id, string $credit_id, \WP_Post $show ): string {
    $promo = my_plugin_get_current_promo();
    return str_replace( '{{PROMO_CODE}}', $promo, $body );
}, 10, 4 );

Affects

  • Episode credits stamp output stored in _benecaster_stamped_credit