Skip to main content

benecaster_shortcode_base_styles

Filter Free

Whether Benecaster’s base stylesheet for its front-end shortcodes loads. The stylesheet (style handle benecaster-shortcodes) covers ten shortcodes — the player, episode lists, latest-episode card, pricing table, episode navigation, related episodes, and the share, social, platform and RSS links — and loads only on a page where one of them renders. The episode page and archive card templates (episode/player.php and archive/episode-card/player.php) load it too when they play a video or an embed, never for audio, so the video fits its column. Turning the stylesheet off removes that sizing as well.

Return false for a theme that styles these shortcodes itself. The handle is then registered with no file, so every request for it — Benecaster’s own, a block editor preview’s, Elementor’s — prints nothing, and the editor matches the front end.

Use this filter, not wp_dequeue_style(). The shortcodes load the stylesheet while the page body renders, after wp_enqueue_scripts has run, so a dequeue there finds nothing and the file is loaded a moment later anyway.

Read once, on init. Add it from functions.php or a plugin, never from inside a template.

You may not need to turn it off. Every rule has zero specificity (each selector is wrapped in :where()), so any theme rule for the same element wins without !important. The common knobs are custom properties: --benecaster-gap, --benecaster-radius, --benecaster-border, --benecaster-icon-size and --benecaster-card-min.

Parameters

Name Type Default Description
$enabled bool — Whether the stylesheet loads. Default `true`.

Returns: bool

Example

// functions.php — the theme styles Benecaster's shortcodes itself.
add_filter( 'benecaster_shortcode_base_styles', '__return_false' );

Affects

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