Skip to main content

Replace or suppress the RSS link output

Free Beginner Since v1.0.0

Filter the final output of [benecaster_rss_link]. Use to wrap the link in additional markup, swap in a custom SVG icon, conditionally suppress the link on certain pages, or return a plain URL string regardless of the style attribute.

Code

<?php
// On episode pages, prepend a small "RSS" badge before the link.
add_filter(
    'benecaster_rss_link_output',
    function ( string $html, string $feed_url, array $atts ): string {
        if ( is_singular( 'benecaster_episode' ) ) {
            return '<span class="my-rss-badge">RSS</span>' . $html;
        }
        return $html;
    },
    10, 3
);

View on GitHub →

Hooks Used