常用函数-apply_filters()

0条评论

常用函数-apply_filters()

说明

调用添加到过滤器hook上的函数。在Plugin API上查看过滤器hook列表。

通过调用该函数,可以调用附着在过滤器hook $tag上的回调函数。用$tag参数所指定的新hook的名称调用该函数,可创建一个新的过滤器hook。

用法

<?php apply_filters($tag, $value); ?> 

参数

$tag

(字符串)(必需)过滤器hook的名称

默认值:None

$value

(混合)(必需)连接到$tag上的过滤器可能修改的值

默认值:None

返回的值

(混合)所有连接函数都应用到该函数后,返回$value的结果。

注意:返回值的类型应与$value类型一致,如字符串或数组。

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.