-
-
Save jdevalk/82708afec878e930a905 to your computer and use it in GitHub Desktop.
This removes both the excerpt and the longer encoded content from the RSS feed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes the content from the RSS feed and replaces it with a custom message. | |
* | |
* @param string $content | |
* | |
* @return string | |
*/ | |
function yst_clean_rss( $content ) { | |
if ( is_feed() ) | |
return 'This is a new post on yoast.com, Whoopity Doo!'; | |
return $content; | |
} | |
add_filter( 'the_content_feed', 'yst_clean_rss', 90, 1 ); | |
add_filter( 'the_excerpt_rss', 'yst_clean_rss', 90, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment