Created
June 8, 2018 01:38
-
-
Save ngearing/850ff76dc0e3e6ec8d7506d9e847f9b3 to your computer and use it in GitHub Desktop.
Remove Missing Attachment text from WordPress 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 | |
/** | |
* Remove text from rss feed content and excerpt. | |
* | |
* @param string $content | |
* @return string | |
*/ | |
function remove_feed_text( $content ) { | |
// Replace 'Missing Attachment' text. | |
$content = str_replace( 'Missing Attachment', '', $content ); | |
return $content; | |
} | |
add_filter( 'the_excerpt_rss', 'remove_feed_text', 10, 1 ); | |
add_filter( 'the_content_feed', 'remove_feed_text', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment