函数文档

preview_theme_ob_filter_callback()

💡 云策文档标注

概述

preview_theme_ob_filter_callback() 是一个用于处理预览主题链接的回调函数,旨在控制和维护位置。该函数已在 WordPress 4.3.0 版本中被弃用。

关键要点

  • 这是一个用于 preg_replace_callback() 的回调函数,用于接受和过滤匹配项。
  • 函数参数为必需的数组 $matches,返回字符串。
  • 函数在 WordPress 4.3.0 版本中被弃用,调用时会触发 _deprecated_function() 警告。
  • 函数实现简单,直接返回空字符串。
  • 相关函数包括 _deprecated_function(),用于标记函数为弃用并通知使用情况。

代码示例

function preview_theme_ob_filter_callback( $matches ) {
    _deprecated_function( __FUNCTION__, '4.3.0' );
    return '';
}

注意事项

  • 此函数已弃用,建议在开发中避免使用,并寻找替代方案。
  • 弃用版本为 4.3.0,引入版本为 2.6.0。

📄 原文内容

Manipulates preview theme links in order to control and maintain location.

Description

Callback function for preg_replace_callback() to accept and filter matches.

Parameters

$matchesarrayrequired

Return

string

Source

function preview_theme_ob_filter_callback( $matches ) {
	_deprecated_function( __FUNCTION__, '4.3.0' );
	return '';
}

Changelog

Version Description
4.3.0 Deprecated.
2.6.0 Introduced.