0

I have made the following change to the below file in Seriously Simple Podcasting Plugin:

/wp-content/plugins/seriously-simple-podcasting/templates/feed-podcast.php

The full file can be found here: https://github.com/TheCraigHewitt/Seriously-Simple-Podcasting/blob/master/templates/feed-podcast.php

// iTunes summary is the full episode content, but must be shorter than 4000 characters
$itunes_summary = mb_substr( $content, 0, 3999 );
$itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() );
$gp_description = apply_filters( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID() );

To:

// iTunes summary is the full episode content, but must be shorter than 4000 characters
ob_start();
the_excerpt_rss();
$itunes_summary = mb_substr( ob_get_clean(), 0, 3999 );
$itunes_summary = apply_filters( 'ssp_feed_item_itunes_summary', $itunes_summary, get_the_ID() );
$gp_description = apply_filters( 'ssp_feed_item_gp_description', $itunes_summary, get_the_ID() );

The reason for this is I want the itunes:summary tag in the RSS feed template to pull from the excerpt rather the post content so we can control the itunes summary better.

However I know that doing this will stop me from being able to update the plugin which I don't want and I read about creating a functionality plugin, but I'm unsure on how to create this to edit that file, as I've not done much PHP or playing around with the wordpress code before.

Can anybody assist/advise?

  • have you asked the plugin developer? Can you show the whole function? If it's pluggable it could work. – rudtek Jan 29 '19 at 0:55
1

This is what the ssp_feed_item_itunes_summary filter is for. It lets you change that value through a separate plugin/function. You can read more about filters here.

So rather than making the edit you've made, add a filter to ssp_feed_item_itunes_summary:

function wpse_326975_itunes_summary( $itunes_summary, $post_id ) {
    $itunes_summary = get_the_excerpt( $post_id );

    return $itunes_summary;
}
add_filter( 'ssp_feed_item_itunes_summary', 'wpse_326975_itunes_summary', 10, 2 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.