Skip to main content

Customize imported episode post data during SSP import

Free Beginner

When migrating episodes from Seriously Simple Podcasting (SSP), Benecaster creates a draft episode for each imported post. This filter runs just before each draft is saved, giving you a chance to adjust the episode’s title, content, or initial status. It fires for SSP posts only — PowerPress imports never run it.

$post_data['post_title'] arrives with the setup wizard’s own Strip this prefix from episode titles field already applied, if one was set — this callback sees the already- stripped title and still has the final say over it. When the SSP episode has an iTunes Episode Title, that is the title it starts from, not the post title; read $ssp_post->post_title for the original post title.

A common use: cleaning up or reformatting titles during the import — for example, prepending the show name when merging multiple shows.

Code

<?php
add_filter( 'benecaster_ssp_import_post_data', function ( array $post_data, \WP_Post $ssp_post, int $show_id ): array {
    // Prepend show name to imported episode titles.
    // The title as typed: this is saved into a post, so neither HTML entities nor curly quotes.
    $show_name            = get_post_field( 'post_title', $show_id, 'raw' );
    $post_data['post_title'] = $show_name . ': ' . $post_data['post_title'];
    return $post_data;
}, 10, 3 );

View on GitHub →

Hooks Used

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