钩子文档

insert_with_markers_inline_instructions

💡 云策文档标注

概述

本文档介绍了 WordPress 中的 insert_with_markers_inline_instructions 过滤器,用于在动态生成内容前过滤内联指令。开发者可以通过此过滤器自定义指令数组。

关键要点

  • 过滤器名称:insert_with_markers_inline_instructions
  • 参数:$instructions(字符串数组,内联指令行)和 $marker(字符串,被插入的标记)
  • 用途:允许修改在 insert_with_markers() 函数中插入文件(如 .htaccess)前的内联指令
  • 相关函数:insert_with_markers(),位于 wp-admin/includes/misc.php
  • 引入版本:WordPress 5.3.0

📄 原文内容

Filters the inline instructions inserted before the dynamically generated content.

Parameters

$instructionsstring[]
Array of lines with inline instructions.
$markerstring
The marker being inserted.

Source

$instructions = apply_filters( 'insert_with_markers_inline_instructions', $instructions, $marker );

Changelog

Version Description
5.3.0 Introduced.