编辑“WordPress:Plugin API/Filter Reference

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1,118行: 第1,118行:
;found_posts_query: after the list of posts to display is queried from the database, WordPress selects rows in the query results. This filter allows you to do something other than <tt>SELECT FOUND_ROWS()</tt> at that step.
;found_posts_query: after the list of posts to display is queried from the database, WordPress selects rows in the query results. This filter allows you to do something other than <tt>SELECT FOUND_ROWS()</tt> at that step.


;found_posts_query:显示的文章列表从数据库中查询之后,WordPress从查询结果中选饿几组。这个filter能够使你在这个步骤时,做一些其它事,而不是<tt>SELECT FOUND_ROWS()</tt>。
;found_posts_query:


;get_editable_authors: applied to the list of post authors that the current user is authorized to edit in the <tt>get_editable_authors</tt> function.
;get_editable_authors: applied to the list of post authors that the current user is authorized to edit in the <tt>get_editable_authors</tt> function.
;get_editable_authors:应用到文章作者列表,当前用户能够在<tt>get_editable_authors</tt>函数中编辑。


;gettext: applied to the translated text by the <tt>__</tt> and <tt>_e</tt> internationalization functions. Filter function arguments: translated text and untranslated text. Only gets applied if internationalization is in effect, and if the text domain has been loaded.
;gettext: applied to the translated text by the <tt>__</tt> and <tt>_e</tt> internationalization functions. Filter function arguments: translated text and untranslated text. Only gets applied if internationalization is in effect, and if the text domain has been loaded.
;gettext:由the <tt>__</tt>和 <tt>_e</tt>国际化函数,应有到已翻译的文本。Filter function arguments:已翻译的文本和未翻译的文本。如果国际化有效,而且如果文本网页已经载入,就会得到应用。


;get_next_post_join: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: JOIN clause, stay in same category (true/false), list of excluded categories.
;get_next_post_join: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: JOIN clause, stay in same category (true/false), list of excluded categories.
;get_next_post_join: in function <tt>get_next_post</tt>(找到当前显示的文章后面的文章),应用到SQL JOIN clause(如果用户浏览类别归档,一般进入类别表格)。Filter function arguments: JOIN clause,在同一个类别中(正确的/错误的),删除的类别列表。


;get_next_post_sort: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in ascending order with a limit of 1 post). Filter function arguments: ORDER BY clause.
;get_next_post_sort: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in ascending order with a limit of 1 post). Filter function arguments: ORDER BY clause.
;get_next_post_sort:在函数<tt>get_next_post</tt>中,(找到当前显示的文章之后的文章),应用到SQL ORDER BY clause(一般限制按一篇文章日期的降序排列)。Filter function arguments: ORDER BY clause。
;get_next_post_sort:
;get_next_post_sort:


;get_next_post_where: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the next dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories.
;get_next_post_where: in function <tt>get_next_post</tt> (which finds the post after the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the next dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories.
;get_next_post_where:在函数<tt>get_next_post</tt>中,(找到当前显示的文章之后的文章),应用到WHERE clause(一般查找下一篇著名发表日期的文章)。Filter function arguments: WHERE clause,位于同一个类别中(正确的/错误的),已删除的类别列表。


;get_others_drafts: applied to the query that selects the other users' drafts for display in the admin menus.
;get_others_drafts: applied to the query that selects the other users' drafts for display in the admin menus.
;get_others_drafts:应用到挑选其他用户的草稿放到管理菜单的查询中。


;get_previous_post_join: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: join clause, stay in same category (true/false), list of excluded categories.
;get_previous_post_join: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL JOIN clause (which normally joins to the category table if user is viewing a category archive). Filter function arguments: join clause, stay in same category (true/false), list of excluded categories.
;get_previous_post_join:在函数<tt>get_previous_post</tt>中(找到当前显示的文章之前的文章),应用到SQL JOIN clause(如果用户正在阅读类别归档,一般会加入类别表格)。Filter function arguments: join clause,位于同一个类别 (正确的/错误的),已删除的类别列表。


;get_previous_post_sort: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in descending order with a limit of 1 post). Filter function arguments: ORDER BY clause.
;get_previous_post_sort: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL ORDER BY clause (which normally orders by post date in descending order with a limit of 1 post). Filter function arguments: ORDER BY clause.
;get_previous_post_sort:在函数<tt>get_previous_post</tt>中(找到当前显示的文章之前的文章),应用到SQL ORDER BY clause(一般限制为一篇文章的降序顺序)。Filter function arguments: ORDER BY clause。


;get_previous_post_where: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the previous dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories.
;get_previous_post_where: in function <tt>get_previous_post</tt> (which finds the post before the currently-displayed post), applied to the SQL WHERE clause (which normally looks for the previous dated published post). Filter function arguments: WHERE clause, stay in same category (true/false), list of excluded categories.
;get_previous_post_where:在函数<tt>get_previous_post</tt>中找到当前显示的文章之前的文章),应用到SQL WHERE clause(一般查找先前已发表的文章)。Filter function arguments: WHERE clause,位于同一个类别(正确的/错误的),已删除的类别列表。


;get_users_drafts: applied to the query that selects the users' drafts for display in the admin menus.
;get_users_drafts: applied to the query that selects the users' drafts for display in the admin menus.
;get_users_drafts:应用到挑选用户的草稿显示到管理菜单的查询中。


;locale: applied to the locale by the <tt>get_locale</tt> function.
;locale: applied to the locale by the <tt>get_locale</tt> function.
;locale:由<tt>get_locale</tt>函数应用到locale。


;mod_rewrite_rules : applied to the list of rewrite rules given to the user to put into their .htaccess file when they change their permalink structure. (Note: replaces deprecated filter <tt>rewrite_rules</tt>.)
;mod_rewrite_rules : applied to the list of rewrite rules given to the user to put into their .htaccess file when they change their permalink structure. (Note: replaces deprecated filter <tt>rewrite_rules</tt>.)
;mod_rewrite_rules :应用到用户更改permalink结构时,放入.htaccess文件中的rewrite规则。(注:取代已取消的filter <tt>rewrite_rules</tt>。)


;post_limits: applied to the <tt>LIMIT</tt> clause of the query that returns the post array.
;post_limits: applied to the <tt>LIMIT</tt> clause of the query that returns the post array.
;post_limits:应用到返回文章数组的查询的<tt>LIMIT</tt> clause。


;posts_distinct : allows a plugin to add a <tt>DISTINCTROW</tt> clause to the query that returns the post array.  
;posts_distinct : allows a plugin to add a <tt>DISTINCTROW</tt> clause to the query that returns the post array.  
;posts_distinct :允许插件将<tt>DISTINCTROW</tt> clause添加到返回文章数组的查询中。


;posts_fields: applied to the field list for the query that returns the post array.
;posts_fields: applied to the field list for the query that returns the post array.
;posts_fields:应用到返回文章数组的查询的field列表。


;posts_groupby: applied to the <tt>GROUP BY</tt> clause of the query that returns the post array (normally empty).
;posts_groupby: applied to the <tt>GROUP BY</tt> clause of the query that returns the post array (normally empty).
;posts_groupby:应用到返回文章数组(一般为空的)的查询的<tt>GROUP BY</tt> clause。


;posts_join_paged : applied to the <tt>JOIN</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the JOIN, so this is actually equivalent to <tt>posts_join</tt>).
;posts_join_paged : applied to the <tt>JOIN</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the JOIN, so this is actually equivalent to <tt>posts_join</tt>).
;posts_join_paged :计算好内存分页后(但是内存分页并不影响JOIN,因此这事实上与<tt>posts_join</tt>等同)应用到返回文章数组的查询的<tt>JOIN</tt> clause。


;posts_orderby: applied to the <tt>ORDER BY</tt> clause of the query that returns the post array.
;posts_orderby: applied to the <tt>ORDER BY</tt> clause of the query that returns the post array.
;posts_orderby:应用到返回文章数组的查询的<tt>ORDER BY</tt> clause。


;posts_request: applied to the entire SQL query that returns the post array, just prior to running the query.
;posts_request: applied to the entire SQL query that returns the post array, just prior to running the query.
;posts_request:应用到运行查询之前,返回文章数组的整个SQL 查询。


;post_rewrite_rules: applied to the post-related rewrite rules after they are generated.
;post_rewrite_rules: applied to the post-related rewrite rules after they are generated.
;post_rewrite_rules:应用到规则产生后,与文章相关的rewrite规则。


;root_rewrite_rules: applied to the root-level rewrite rules after they are generated.
;root_rewrite_rules: applied to the root-level rewrite rules after they are generated.
;root_rewrite_rules:应用到根级别的rewrite规则。


;page_rewrite_rules: applied to the page-related rewrite rules after they are generated.
;page_rewrite_rules: applied to the page-related rewrite rules after they are generated.


;page_rewrite_rules: rewrite规则产生后,应用到网页相关的rewrite规则。
;posts_where_paged: applied to the <tt>WHERE</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the WHERE, so this is actually equivalent to <tt>posts_where</tt>).
;posts_where_paged: applied to the <tt>WHERE</tt> clause of the query that returns the post array, after the paging is calculated (though paging does not affect the WHERE, so this is actually equivalent to <tt>posts_where</tt>).
;posts_where_paged:内存分页计算好后,应用到返回文章数组的查询的<tt>WHERE</tt> clause(但是内存分页不影响WHERE,因此这事实上与<tt>posts_where</tt>是对等的)。


;posts_join : applied to the <tt>JOIN</tt> clause of the query that returns the post array. This is typically used to add a table to the  <tt>JOIN</tt>, in combination with the <tt>posts_where</tt> filter.
;posts_join : applied to the <tt>JOIN</tt> clause of the query that returns the post array. This is typically used to add a table to the  <tt>JOIN</tt>, in combination with the <tt>posts_where</tt> filter.
;posts_join :应用到返回文章数组的查询的<tt>JOIN</tt> clause。通常使用这个来给<tt>JOIN</tt>添加表格,与<tt>posts_where</tt> filter结合在一起。


;posts_where : applied to the <tt>WHERE</tt> clause of the query that returns the post array.
;posts_where : applied to the <tt>WHERE</tt> clause of the query that returns the post array.


;posts_where :应用到返回文章数组的查询的<tt>WHERE</tt> clause。
;query: applied to all queries (at least all queries run after plugins are loaded).
;query: applied to all queries (at least all queries run after plugins are loaded).
;query:应用到所有查询(至少插件载入后,所有查询运行)。


;query_string: deprecated - use <tt>query_vars</tt> or <tt>request</tt> instead.
;query_string: deprecated - use <tt>query_vars</tt> or <tt>request</tt> instead.
;query_string:已取消-使用<tt>query_vars</tt>或者<tt>request</tt>代替。
;query_vars: applied to the list of public WordPress query variables before the SQL query is formed. Useful for removing extra permalink information the plugin has dealt with in some other manner.
;query_vars: applied to the list of public WordPress query variables before the SQL query is formed. Useful for removing extra permalink information the plugin has dealt with in some other manner.
;query_vars:SQL查询形成之前,应用到公共的WordPress查询变数列表上。有利于移除插件使用其它方式处理额外的permalink信息。


;request: like <tt>query_vars</tt>, but applied after "extra" and private query variables have been added.
;request: like <tt>query_vars</tt>, but applied after "extra" and private query variables have been added.
;request:像<tt>query_vars</tt>,但是"extra"和保密查询变数添加后,应用。


;rewrite_rules_array: applied to the entire rewrite rules array after it is generated.
;rewrite_rules_array: applied to the entire rewrite rules array after it is generated.
;rewrite_rules_array:创建后,应用到整个rewrite规则。


;search_rewrite_rules: applied to the search-related rewrite rules after they are generated.
;search_rewrite_rules: applied to the search-related rewrite rules after they are generated.
;search_rewrite_rules:创建后,应用到搜索相关的rewrite规则。


;the_posts : applied to the list of posts queried from the database after minimal processing for permissions and draft status on single-post pages.
;the_posts : applied to the list of posts queried from the database after minimal processing for permissions and draft status on single-post pages.
;the_posts :在单篇文章网页上处理权限和草稿状态后,应用到数据库中已查询的文章列表。


;update_user_query: applied to the update query used to update user information, prior to running the query.
;update_user_query: applied to the update query used to update user information, prior to running the query.
;update_user_query:应用到,运行查询之前,用于更新用户信息的更新查询。


;uploading_iframe_src: applied to the HTML src tag for the uploading iframe on the post and page editing screens.
;uploading_iframe_src: applied to the HTML src tag for the uploading iframe on the post and page editing screens.
;uploading_iframe_src:应用到HTML src 标签,文章和网页编辑界面上的更新结构。


;wp_redirect: applied to a redirect URL by the default <tt>wp_redirect</tt> function. Filter function arguments: URL, HTTP status code. Note that <tt>wp_redierct</tt> is also a "pluggable" function, meaning that plugins can override it; see [[WordPress:Plugin API]]).
;wp_redirect: applied to a redirect URL by the default <tt>wp_redirect</tt> function. Filter function arguments: URL, HTTP status code. Note that <tt>wp_redierct</tt> is also a "pluggable" function, meaning that plugins can override it; see [[WordPress:Plugin API]]).
;wp_redirect:由默认的<tt>wp_redirect</tt>函数应用到redirect URL。Filter function arguments: URL, HTTP status代码。注意<tt>wp_redierct</tt>也是个"pluggable"函数,指的是插件可以取代这个函数;请看看[[WordPress:Plugin API|插件API]]。)


;xmlrpc_methods : applied to list of defined XMLRPC methods for the XMLRPC server.
;xmlrpc_methods : applied to list of defined XMLRPC methods for the XMLRPC server.
;xmlrpc_methods :应用到XMLRPC服务器已定义的XMLRPC methods列表。


;wp_mail_from : applied before any mail is sent by the wp_mail function. Supplied value is the calculated from address which is wordpress at the current hostname (set by $_SERVER['SERVER_NAME']). The filter should return an email address or name/email combo in the form "user@example.com" or "Name <user@example.com>" (without the quotes!).
;wp_mail_from : applied before any mail is sent by the wp_mail function. Supplied value is the calculated from address which is wordpress at the current hostname (set by $_SERVER['SERVER_NAME']). The filter should return an email address or name/email combo in the form "user@example.com" or "Name <user@example.com>" (without the quotes!).
;wp_mail_from :在wp_mail函数发送任何邮件之前,应用。支持的参数值,从WordPress当前的主机名中计算(由$_SERVER['SERVER_NAME']设置)。Filter应该以"user@example.com"或者"Name <user@example.com>"形式返回电子邮件地址或者名称/电子邮件combo。(没有引号!)。


;wp_mail_from_name : applied before any mail is sent by the wp_mail function. The filter should return a name string to be used as the email from name.
;wp_mail_from_name : applied before any mail is sent by the wp_mail function. The filter should return a name string to be used as the email from name.
;wp_mail_from_name : wp_mail函数发送任何邮件之前,应用。Filter应该返回一个名称字符串,用在名称中的电子邮件。


== Further Reading ==
== Further Reading ==
== 深入阅读 ==


* [[WordPress:Writing a Plugin]] - description of how to write a plugin
* [[WordPress:Writing a Plugin]] - description of how to write a plugin
第1,286行: 第1,205行:
* [http://adambrown.info/p/wp_hooks WordPress Hooks Database], a database of all WordPress' hooks, showing which version they come from, and linking to the source code spots that use them
* [http://adambrown.info/p/wp_hooks WordPress Hooks Database], a database of all WordPress' hooks, showing which version they come from, and linking to the source code spots that use them
* [http://blog.taragana.com/index.php/archive/wordpress-2x-hooks-for-action-comprehensive-list-for-plugin-and-theme-developers/ Angsuman's list], a comprehensive listing of WordPress action hooks with documentation and source code location information. It contains all documented and undocumented action hooks in WordPress 2.0.
* [http://blog.taragana.com/index.php/archive/wordpress-2x-hooks-for-action-comprehensive-list-for-plugin-and-theme-developers/ Angsuman's list], a comprehensive listing of WordPress action hooks with documentation and source code location information. It contains all documented and undocumented action hooks in WordPress 2.0.
* [[WordPress:Writing a Plugin|编写插件]] – 描述怎样编写插件
* [[WordPress:Plugin API|插件API]] – 关于怎样使用filters和actions的文章
* [[WordPress:Plugin API/Action Reference|插件API/Action Reference]] - Action hooks的reference列表
* [[WordPress:Plugin Resources|插件资源]] – 插件相关的资源的全面列表
* [http://codex.wordpress.org/用户:Skippy Skippy的列表] 关于actions 和 filters
* [http://wphooks.flatearth.org WordPress Hooks], 正在进行的工作,所有的WordPress hook的目录。
* [http://adambrown.info/p/wp_hooks WordPress Hooks 数据库], 所有的WordPress hooks的数据库,显示来自哪个版本,链接到使用这些hooks的源代码站点。
* [http://blog.taragana.com/index.php/archive/wordpress-2x-hooks-for-action-comprehensive-list-for-plugin-and-theme-developers/ Angsuman的列表], a comprehensive listing of WordPress action hooks 的完整列表,带有文档和源代码位置信息。包含了WordPress2.0中所有已归档和未归档的action hooks。
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)