函数原型
get_the_content_feed( string $feed_type = null ): string
函数描述
Retrieves the post content for feeds.
是否弃用
未弃用
函数参数
-
$feed_type
string
Optional - The type of feed. rss2 | atom | rss | rdf
Default:
null
函数返回值
string The filtered content.
函数位置
File: wp-includes/feed.php.
函数源码
function get_the_content_feed( $feed_type = null ) {
if ( ! $feed_type ) {
$feed_type = get_default_feed();
}
/** This filter is documented in wp-includes/post-template.php */
$content = apply_filters( 'the_content', get_the_content() );
$content = str_replace( ']]>', ']]>', $content );
/**
* Filters the post content for use in feeds.
*
* @since 2.9.0
*
* @param string $content The current post content.
* @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'.
* Default 'rss2'.
*/
return apply_filters( 'the_content_feed', $content, $feed_type );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.9.0 | Introduced. |

