Skip to main content

benecaster_feed_sync_should_import

Filter Premium migration-wizard Since v1.0.0

Filters whether a specific RSS item should be imported as a draft. Return false to skip. Use to filter out trailers, bonus episodes, or episodes matching specific criteria.

Parameters

Name Type Default Description
$should_import bool Whether to import this RSS item
$rss_item SimpleXMLElement The RSS item being evaluated
$show_id int ID of the show

Returns: bool

Example

add_filter( 'benecaster_feed_sync_should_import', function( $should_import, $rss_item, $show_id ) {
    // Skip any RSS item whose title contains '[trailer]' (case-insensitive).
    $title = (string) $rss_item->title;
    if ( stripos( $title, '[trailer]' ) !== false ) {
        return false;
    }
    return $should_import;
}, 10, 3 );