default_excerpt

过滤钩子
apply_filters( 'default_excerpt', $post_excerpt, $post )
参数
  • (string) $post_excerpt Default post excerpt.
    Required:
  • (WP_Post) $post Post object.
    Required:
定义位置
相关勾子
default_feedwp_default_scriptsthe_excerptcomment_excerptdefault_content
相关方法
wp_default_scriptsthe_excerpthas_excerptcomment_excerptget_the_excerptget_default_feed
引入
1.5.0
弃用
-

default_excerpt: 这是一个WordPress的过滤钩子,允许开发者定制默认的摘录长度和内容。该钩子传递一个参数:$excerpt(默认摘录内容)。

过滤最初在”写文章”表格中使用的默认文章摘录。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
$post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-01 23:19:48

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: