benecaster_qr_code_output
Filters the full rendered HTML output of the benecaster_qr_code shortcode, after the QR code SVG and download buttons have been compiled. Use to wrap the output, inject additional markup such as a caption or heading, or replace the HTML entirely.
The type key in $atts indicates whether this is a subscriber-specific feed QR code ('feed') or a public signup QR code ('signup'), so you can apply different behavior per type.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$html |
string |
— | Full rendered shortcode output |
$show_id |
int |
— | ID of the show |
$atts |
array |
— | Resolved shortcode attributes |
Returns:
string
Examples
Wrap in print-friendly container
add_filter( 'benecaster_qr_code_output', function ( $html, $show_id, $atts ) {
return '<div class="printable-qr">' . $html . '</div>';
}, 10, 3 );
Add explanatory caption below the QR code
add_filter( 'benecaster_qr_code_output', function ( string $html, int $show_id, array $atts ): string {
$caption = '<p class="qr-caption">Scan with your phone to add this podcast to your app.</p>';
return $html . $caption;
}, 10, 3 );
Affects
- [benecaster_qr_code](/shortcodes/benecaster-qr-code/) shortcode