get_the_content()获取当前文章的正文内容

目录

描述

译文

检索文章内容。

原文

Retrieve the post content. (Must be used in a Loop)

An important difference from the_content() is that get_the_content() does not pass the content through the 'the_content'. This means that get_the_content() will not auto-embed videos or expand shortcodes, among other things.

get_the_content() 描述

用法

<?php get_the_content$more_link_text$stripteaser ?>

get_the_content() 用法

参数

$more_link_text

(string) (可选) Content for when there is more text.

默认值: null

$stripteaser

(boolean) (可选) Strip teaser content before the more text.

默认值: false

get_the_content() 参数

返回值

(string) 

get_the_content() 返回值

示例

Display the post content, ending with "Read more" if needed

get_the_content() 示例

注意

If you use plugins that 过滤器 content (add_filter('the_content')), then this will not apply the 过滤器s, unless you call it this way (using apply_filters):


<?php apply_filters('the_content',get_the_content$more_link_text$stripteaser$more_file )) ?>

get_the_content() 注意

历史

添加于 版本: 0.71

get_the_content() 历史

源文件

get_the_content() 函数的代码位于 wp-includes/post-template.php.

get_the_content() 源文件