钩子文档

print_late_styles

💡 云策文档标注

概述

print_late_styles 是一个 WordPress 过滤器,用于控制是否打印那些在 HTML head 部分之后排队的样式。它允许开发者动态调整样式输出行为。

关键要点

  • 过滤器名称:print_late_styles
  • 参数:$print(布尔值),默认为 true,表示是否打印“迟到”的样式
  • 用途:管理样式队列中延迟加载的样式输出
  • 相关函数:print_late_styles(),位于 wp-includes/script-loader.php
  • 引入版本:WordPress 3.3.0

代码示例

if ( apply_filters( 'print_late_styles', true ) ) {
    // 打印样式的代码
}

📄 原文内容

Filters whether to print the styles queued too late for the HTML head.

Parameters

$printbool
Whether to print the 'late' styles. Default true.

Source

if ( apply_filters( 'print_late_styles', true ) ) {

Changelog

Version Description
3.3.0 Introduced.