WordPress: Function Reference/apply filters:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
== Description ==
== 描述==
== 描述==
Call the functions added to a filter hook. See the [[WordPress:Plugin API]] for a list of filter hooks.


调用添加到filter hook的函数。请看看[[WordPress:Plugin API|插件API]]上的filter hooks列表。
调用添加到filter hook的函数。请看看[[WordPress:Plugin API|插件API]]上的filter hooks列表。
The callback functions attached to filter hook <tt>$tag</tt> are invoked by calling this function. This function can be used to create a new filter hook by simply calling this function with the name of the new hook specified using the <tt>$tag</tt> parameter.


附加到filter hook <tt>$tag</tt>上的callback函数,通过调用这个函数得到调用。只要使用<tt>$tag</tt>参数,用规定的新的hook的名称,调用这个函数,这个函数可以用来创建一个新的filter hook
附加到filter hook <tt>$tag</tt>上的callback函数,通过调用这个函数得到调用。只要使用<tt>$tag</tt>参数,用规定的新的hook的名称,调用这个函数,这个函数可以用来创建一个新的filter hook
== Usage ==


== 用法 ==
== 用法 ==
第17行: 第9行:
%%% <?php apply_filters($tag, $string); ?> %%%
%%% <?php apply_filters($tag, $string); ?> %%%


%%% <?php apply_filters($tag, $string); ?> %%%
== Parameters ==
== 参数 ==
== 参数 ==
{{Parameter|$tag|string|The name of the filter hook.}}
{{Parameter|$string|string|The text on which the filters hooked to <tt>$tag</tt> are applied on.}}


{{Parameter|$tag|string| filter hook的名称。}}
{{Parameter|$tag|string| filter hook的名称。}}
{{Parameter|$string|string| 应用filters hooked to <tt>$tag</tt>的文本 }}
{{Parameter|$string|string| 应用filters hooked to <tt>$tag</tt>的文本 }}


== Return ==


== 返回==
== 返回==


(''string'') The text in <tt>$string</tt> after all hooked functions are applied to it.
(''string'')应用了所有的hooked 参数之后, <tt>$string</tt>中的文本。
(''string'')应用了所有的hooked 参数之后, <tt>$string</tt>中的文本。

2008年7月26日 (六) 15:04的最新版本

描述[ ]

调用添加到filter hook的函数。请看看插件API上的filter hooks列表。

附加到filter hook $tag上的callback函数,通过调用这个函数得到调用。只要使用$tag参数,用规定的新的hook的名称,调用这个函数,这个函数可以用来创建一个新的filter hook

用法[ ]

%%% <?php apply_filters($tag, $string); ?> %%%

参数[ ]

返回[ ]

(string)应用了所有的hooked 参数之后, $string中的文本。