Skip to content

Instantly share code, notes, and snippets.

@jirsbek
Last active August 27, 2021 16:20
Show Gist options
  • Save jirsbek/e824b20ee88bd5752846016a49836649 to your computer and use it in GitHub Desktop.
Save jirsbek/e824b20ee88bd5752846016a49836649 to your computer and use it in GitHub Desktop.
<?php
/**
* Add RSS Feed Summary Params
*
* Source: https://wordpress.stackexchange.com/a/195197
*/
add_action('rss_tag_pre', function ($tag) {
$summary = filter_input(INPUT_GET, 'summary', FILTER_SANITIZE_STRING);
if ('yes' === $summary)
add_filter('option_rss_use_excerpt', '__return_true');
elseif ('no' === $summary)
add_filter('option_rss_use_excerpt', '__return_false');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment