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

来自站长百科
跳转至: 导航、​ 搜索
(新页面: == Description == Call the functions added to a filter hook. See the WordPress:Plugin API for a list of filter hooks. The callback functions attached to filter hook <tt>$tag</tt> ar...)
 
无编辑摘要
第1行: 第1行:
== Description ==
== Description ==
== 描述==


Call the functions added to a filter hook. See the [[WordPress:Plugin API]] for a list of filter hooks.
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列表。


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.
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


== Usage ==
== Usage ==
== 用法 ==
%%% <?php apply_filters($tag, $string); ?> %%%


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


== Parameters ==
== Parameters ==
== 参数 ==
{{Parameter|$tag|string|The name of the filter hook.}}
{{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|$string|string|The text on which the filters hooked to <tt>$tag</tt> are applied on.}}
{{Parameter|$tag|string| filter hook的名称。}}
{{Parameter|$string|string| 应用filters hooked to <tt>$tag</tt>的文本 }}


== Return ==
== Return ==
== 返回==


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

2008年7月21日 (一) 14:34的版本

Description

描述

Call the functions added to a filter hook. See the WordPress:Plugin API for a list of filter hooks.

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

The callback functions attached to filter hook $tag 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 $tag parameter.

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

Usage

用法

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

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

Parameters

参数

Return

返回

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