WordPress:Plugin API/Filter Reference

来自站长百科
跳转至: 导航、​ 搜索

This article is a (hopefully complete) list of the filter hooks available for use in plugin development in Version 2.1 and above of WordPress. For more information:

这篇文章是WordPress2.1以及更高版本中的插件发展中可以使用的filter hooks的列表(希望全面)。更多的信息:

  • 学习更多关于filter和action hooks是什么的内容,请看看插件API
  • 学习更多编写插件的内容,请看看编写插件

Note: If you want to add to or clarify this documentation, please follow the style of the existing entries. Describe what data the filter is applied to, and if the filter function takes additional arguments, describe the argument list.

注:如果你想要添加或者解释这个文件,请采用当前的文章格式。描述filter应用到什么数据,如果filter函数带有额外的参数,描述参数列表。

Post, Page, and Attachment (Upload) Filters[ ]

文章,网页,和Attachment (上传) Filters[ ]

See also [[WordPress:#Category Filters]], [[WordPress:#Author and User Filters]], [[WordPress:#Link Filters]], [[WordPress:#Date and Time Filters]], and [[WordPress:#Administrative Filters]] below.

也看看下面的[[WordPress:#Category Filters|类别Filters]], [[WordPress:#Author and User Filters|#作者和用户Filters]], [[WordPress:#Link Filters|#链接Filters]], [[WordPress:#Date and Time Filters|#日期和时间Filters]], 和[[WordPress:#Administrative Filters|#管理Filters]]。

Database Reads[ ]

数据库 Reads[ ]

Filters in this section are applied to information read from the database, prior to displaying on a page or editing screen.

这个部分的Filters应用到来自数据库的信息,在显示网页或者编辑界面之前。

attachment_icon
applied to the icon for an attachment in the get_attachment_icon function. Filter function arguments: icon file as an HTML IMG tag, attachment ID.
attachment_icon
get_attachment_icon函数中的附属使用图标。Filter函数参数:图标文件作为HTML图像标签,附属ID。
attachment_innerHTML
applied to the title to be used for an attachment if there is no icon, in the get_attachment_innerHTML function. Filter function arguments: inner HTML (defaults to the title), attachment ID.
attachment_innerHTML
如果get_attachment_innerHTML函数中没有图标,应用到attachment中的标题。Filter function arguments:内置HTML(默认为标题),attachment ID。
content_edit_pre
applied to post content prior to display for editing.
content_edit_pre
显示编辑文章内容之前,应用到文章内容。
excerpt_edit_pre
applied to post excerpt prior to display for editing.
excerpt_edit_pre
显示编辑摘录之前,应用到摘录中。
get_attached_file
applied to the attached file information retrieved by the get_attached_file function. Filter function arguments: file information, attachment ID.
get_attached_file
应用到get_attached_file函数得到的附件信息。Filter function arguments:文件信息, attachment ID。
get_enclosed
applied to the enclosures list for a post by the get_enclosed function.
get_enclosed
get_enclosed函数将这个filter应用到文章enclosures列表上。
get_pages
applied to the list of pages returned by the get_pages function. Filter function arguments: list of pages (each item of which contains a page data array), get_pages function argument list (telling which pages were requested).
get_pages
应用到get_pages函数返回的网页列表上。Filter function arguments:网页列表(每个网页包含网页数据数组),get_pages函数参数列表(告知请求哪个网页)。
get_pung
applied to the list of pinged URLs for a post by the get_pung function.
get_pung
get_pung函数将这个filter应用到文章pinged URLs列表上。
get_the_excerpt
applied to the post's excerpt in the get_the_excerpt function.
get_the_excerpt
应用到get_the_excerpt函数中的文章摘录中。
get_the_guid
applied to the post's GUID in the get_the_guid function.
get_the_guid
应用到get_the_guid函数中的文章GUID中。
get_to_ping
applied to the list of URLs to ping for a post by the get_to_ping function.
get_to_ping
应用到URLs列表,get_to_ping函数ping文章。
icon_dir
applied to the template's image directory in several functions. Basically allows a plugin to specify that icons for MIME types should come from a different location.
icon_dir
应用到几个函数中的模板的图像目录。一般允许插件规定MIME类型的插件应该来自不同的位置。
icon_dir_uri
applied to the template's image directory URI in several functions. Basically allows a plugin to specify that icons for MIME types should come from a different location.
icon_dir_uri
应用到几个函数中的模板的图像目录URI。一般允许插件规定MIME类型的插件应该来自不同的位置。
prepend_attachment
applied to the HTML to be prepended by the prepend_attachment function.
prepend_attachment
应用到HTML,前面附有prepend_attachment函数。
sanitize_title
applied to a post title by the sanitize_title function, after stripping out HTML tags.
sanitize_title
去除HTML标签后,由sanitize_title函数应有到文章标题。
single_post_title
applied to the post title when used to create a blog page title by the wp_title and single_post_title functions.
single_post_title
wp_titlesingle_post_title函数用来创建博客网页标题的时候,应用到文章标题。
the_content
applied to the post content retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).
the_content
应用到从数据库中获取的文章内容中,在发表到界面上之前(也用于一些其它的操作,如trackbacks)。
the_content_rss
applied to the post content prior to including in an RSS feed.
the_content_rss
包含在RSS feed之前,应用到文章内容中。
the_editor_content
applied to post content before putting it into a rich editor window.
the_editor_content
放入丰富的编辑器窗口之前,应用到文章内容中。
the_excerpt
applied to the post excerpt (or post content, if there is no excerpt) retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).
the_excerpt
应用到数据库返回的文章摘录(如果没有摘录,用于文章内容),在这些内容发表到界面上之前应用(也用于一些其它的操作,如trackbacks)。
the_excerpt_rss
applied to the post excerpt prior to including in an RSS feed.
the_excerpt_rss
包含在RSS feed之前,应用到文章摘录。
the_tags
applied to the tags retrieved from the database, prior to printing on the screen.
the_tags
应用到从数据库中返回,还没有出现在界面上的标签上。
the_title
applied to the post title retrieved from the database, prior to printing on the screen (also used in some other operations, such as trackbacks).
the_title
用在从数据库中返回,还没有出现在界面的文章标题上(也用于一些其它的操作,如trackbacks)。
the_title_rss
applied to the post title before including in an RSS feed (after first filtering with the_title.
the_title_rss
应用到文章标题,然后包含在RSS feed中(首先filtering with the_title
title_edit_pre
applied to post title prior to display for editing.
title_edit_pre
应用到文章标题,再显示编辑。
wp_dropdown_pages
applied to the HTML dropdown list of WordPress pages generated by the wp_dropdown_pages function.
wp_dropdown_pages
应用到wp_dropdown_pages函数产生的WordPress网页HTML下拉列表。
wp_list_pages
applied to the HTML list generated by the wp_list_pages function.
wp_list_pages
应用到wp_list_pages函数产生的HTML列表上。
wp_list_pages_excludes
applied to the list of excluded pages (an array of page IDs) in the wp_list_pages function.
wp_list_pages_excludes
应用到wp_list_pages函数中删除的网页列表(一组网页IDs)。
wp_get_attachment_metadata
applied to the attachment metadata retrieved by the wp_get_attachment_metadata function. Filter function arguments: meta data, attachment ID.
wp_get_attachment_metadata
应用到wp_get_attachment_metadata函数返回的attachment metadata。Filter function arguments: meta data, attachment ID。
wp_get_attachment_thumb_file
applied to the attachment thumbnail file retrieved by the wp_get_attachment_thumb_file function. Filter function arguments: thumbnail file, attachment ID.
wp_get_attachment_thumb_file
应用到wp_get_attachment_thumb_file函数返回的attachment thumbnail文件。Filter function arguments: thumbnail 文件, attachment ID。
wp_get_attachment_thumb_url
applied to the attachment thumbnail URL retrieved by the wp_get_attachment_thumb_URL function. Filter function arguments: thumbnail URL, attachment ID.
wp_get_attachment_thumb_url
应用到wp_get_attachment_thumb_URL函数返回的attachment thumbnail URL。Filter function arguments: thumbnail URL, attachment ID。
wp_get_attachment_url
applied to the attachment URL retrieved by the wp_get_attachment_url function. Filter function arguments: URL, attachment ID.
wp_get_attachment_url
应用到wp_get_attachment_url函数返回的attachment URL。Filter function arguments: URL, attachment ID。
wp_mime_type_icon
applied to the MIME type icon for an attachment calculated by the wp_mime_type_icon function. Filter function arguments: icon URI calculated, MIME type, post ID.
wp_mime_type_icon
应用到wp_mime_type_icon函数计算的attachment的MIME类型图标。Filter function arguments: icon URI calculated, MIME类型, 文章 ID
wp_title
applied to the blog page title before sending to the browser in the wp_title function.
wp_title
应用到博客网页标题,再发送到wp_title函数中的浏览器。

Database Writes[ ]

Database Writes[ ]

Filters in this section are applied to information prior to saving to the database.

这个部分的filters用于还没有保存到数据库的信息。

add_ping
applied to the new value of the pinged field on a post when a ping is added, prior to saving the new information in the database.
add_ping
添加ping时,应用到文章pinged区的新的参数值上,在数据库中保存新的信息之前。
attachment_max_dims
applied to the maximum image dimensions before reducing an image size. Filter function input (and return value) is either false (if no maximum dimensions have been specified) or a two-item list (width, height).
attachment_max_dims
减小图像尺寸之前,应用到最大的图像尺寸。Filter function输入(并且返回值)是错误的(如果没有规定最大的尺寸)或者两项内容的列表(宽度,高度)。
category_save_pre
applied to post category comma-separated list prior to saving it in the database (also used for attachments).
category_save_pre
应用到用逗号分开的文章类别列表上,然后再保存到数据库(也用于attachments)。
comment_status_pre
applied to post comment status prior to saving it in the database (also used for attachments).
comment_status_pre
应用到文章评论级别,然后再保存到数据库(也用于attachments)。
content_filtered_save_pre
applied to filtered post content prior to saving it in the database (also used for attachments).
content_filtered_save_pre
应用到已过滤的文章内容,然后再保存到数据库(也用于attachments)。
content_save_pre
applied to post content prior to saving it in the database (also used for attachments).
content_save_pre
应用到文章内容,然后再保存到数据库(也用于attachments)。
excerpt_save_pre
applied to post excerpt prior to saving it in the database (also used for attachments).
excerpt_save_pre
应用到文章摘录,然后再保存到数据库(也用于attachments)。
name_save_pre
applied to post name prior to saving it in the database (also used for attachments).
name_save_pre
应用到文章名,然后再保存到数据库(也用于attachments)。
phone_content
applied to the content of a post submitted by email, before saving.
phone_content
保存之前,应用到通过电子邮件发表的文章内容。
ping_status_pre
applied to post ping status prior to saving it in the database (also used for attachments).
ping_status_pre
应用到文章ping状态,然后再保存到数据库(也用于attachments)。
post_mime_type_pre
applied to the MIME type for an attachment prior to saving it in the database.
post_mime_type_pre
应用到attachment的MIME类型,然后再保存到数据库。
status_save_pre
applied to post status prior to saving it in the database.
status_save_pre
应用到文章状态,然后再保存到数据库。
thumbnail_filename
applied to the file name for the thumbnail when uploading an image.
thumbnail_filename
上传新的图像的时候,应用到小图像的文件名。
wp_thumbnail_creation_size_limit
applied to the size of the thumbnail when uploading an image. Filter function arguments: max file size, attachment ID, attachment file name.
wp_thumbnail_creation_size_limit
上传图像的时候,应用到小图像的尺寸。Filter function arguments: 最大的文件尺寸, attachment ID, attachment 文件名。
wp_thumbnail_max_side_length
applied to the size of the thumbnail when uploading an image. Filter function arguments: image side max size, attachment ID, attachment file name.
wp_thumbnail_max_side_length
上传图像的时候,应用到小图像的尺寸。Filter function arguments:图像边缘最大尺寸,attachment ID, attachment 文件名。
title_save_pre
applied to post title prior to saving it in the database (also used for attachments).
title_save_pre
应用到文章标题,然后再保存到数据库(也用于attachments)。
update_attached_file
applied to the attachment information prior to saving in post metadata in the update_attached_file function. Filter function arguments: attachment information, attachment ID.
update_attached_file
应用到attachment信息,然后再保存到update_attached_file函数中的文章metadata。Filter function arguments: attachment信息, attachment ID
wp_delete_file
applied to an attachment file name just before deleting.
wp_delete_file
删除之前,应用到attachment文件名。
wp_generate_attachment_metadata
applied to the attachment metadata array before saving in the database.
wp_generate_attachment_metadata
保存到数据库之前,应用到attachment metadata array。
wp_update_attachment_metadata
applied to the attachment metadata just before saving in the wp_update_attachment_metadata function. Filter function arguments: meta data, attachment ID.
wp_update_attachment_metadata
保存到wp_update_attachment_metadata函数之前,应用到attachment metadata。Filter function arguments: meta data, attachment ID。

Comment, Trackback, and Ping Filters[ ]

评论, Trackback, 和 Ping Filters[ ]

See also [[WordPress:#Author and User Filters]], [[WordPress:#Link Filters]], [[WordPress:#Date and Time Filters]], and [[WordPress:#Administrative Filters]] below.

也看看下面的[[WordPress:#Author and User Filters|#作者和用户Filters]], [[WordPress:#Link Filters|#链接Filters]], [[WordPress:#Date and Time Filters|#日期和时间Filters]] ,[[WordPress:#Administrative Filters|#管理Filters]]。

Database Reads[ ]

Database Reads[ ]

Filters in this section are applied to information read from the database, prior to displaying on a page or editing screen.

这个部分的Filters适用于来自数据库的,还没有在网页或者编辑界面上显示的信息。

comment_excerpt
applied to the comment excerpt by the comment_excerpt function. See also get_comment_excerpt.
comment_excerpt
通过comment_excerpt函数,应用到评论摘录。也看看get_comment_excerpt
comment_flood_filter
applied when someone appears to be flooding your blog with comments. Filter function arguments: already blocked (true/false, whether a previous filtering plugin has already blocked it; set to true and return true to block this comment in a plugin), time of previous comment, time of current comment.
comment_flood_filter
有人向你的博客滥发评论的时候,可以使用。Filter function arguments: 已经阻止 (正确的/错误的,先前一个过滤插件是否已经阻止;设置为正确的并且返回正确的,阻止插件中的这个评论), 先前评论发表的时间,当前评论发表的时间。
comment_post_redirect
applied to the redirect location after someone adds a comment. Filter function arguments: redirect location, comment info array.
comment_post_redirect
有人添加了评论后,应用到redirect 位置。Filter function arguments: redirect 位置,评论信息数组。
comment_text
applied to the comment text before displaying on the screen by the comment_text function, and in the admin menus.
comment_text
使用comment_text函数,在管理菜单界面中显示之前,应用到评论文本。
comment_text_rss
applied to the comment text prior to including in an RSS feed.
comment_text_rss
应用到评论文本,然后再包含到RSS feed。
comments_array
applied to the array of comments for a post in the comments_template function. Filter function arguments: array of comment information structures, post ID.
comments_array
应用到comments_template函数中的文章的评论数组。Filter function arguments:评论信息结构数字,文章ID。
comments_number
applied to the formatted text giving the number of comments generated by the comments_number function. See also get_comments_number.
comments_number
应用到格式化文本,提供comments_number函数产生的评论数目。也看看get_comments_number
get_comment_excerpt
applied to the comment excerpt read from the database by the get_comment_excerpt function (which is also called by comment_excerpt. See also comment_excerpt.
get_comment_excerpt
应用到get_comment_excerpt函数从数据库中读出的评论摘录中(也称为comment_excerpt。也看看comment_excerpt
get_comment_ID
applied to the comment ID read from the global $comments variable by the get_comment_ID function.
get_comment_ID
应用到get_comment_ID函数从全局 $comments 变量中阅读的评论ID中。
get_comment_text
applied to the comment text of the current comment in the get_comment_text function, which is also called by the comment_text function.
get_comment_text
应用到get_comment_text函数的当请评论的评论文本,也由comment_text函数调用。
get_comment_type
applied to the comment type ("comment", "trackback", or "pingback") by the get_comment_type function (which is also called by comment_type).
get_comment_type
应用到get_comment_type函数的评论类型("评论", "trackback",或者 "pingback")(也由comment_type调用)。
get_comments_number
applied to the comment count read from the $post global variable by the get_comments_number function (which is also called by the comments_number function; see also comments_number filter).
get_comments_number
应用到get_comments_number函数从$post全局变量中读出的评论数目(也由comments_number函数调用:也看看comments_number filter)。
post_comments_feed_link
applied to the feed URL generated for the comments feed by the comments_rss function.
post_comments_feed_link
应用到为comments_rss函数评论feed产生的feed URL中。

Database Writes[ ]

Database Writes[ ]

Filters in this section are applied to information prior to saving to the database.

这个部分的filters应用到信息中,然后再保存到数据库。

comment_save_pre
applied to the comment data just prior to updating/editing comment data. Function arguments: comment data array, with indices "comment_post_ID", "comment_author", "comment_author_email", "comment_author_url", "comment_content", "comment_type", and "user_ID".
comment_save_pre
在更新/编辑评论数据之前,应用到评论数据。Function arguments:评论数据数组,拥有索引"comment_post_ID", "comment_author", "comment_author_email", "comment_author_url", "comment_content", "comment_type", 和"user_ID"。
pre_comment_approved
applied to the current comment's approval status (true/false) to allow a plugin to override. Return true/false and set first argument to true/false to approve/disapprove the comment, and use global variables such as $comment_ID to access information about this comment.
pre_comment_approved
应用到当前得到批准的评论(正确的/错误的),允许插件代替。返回正确的/错误的并且将第一个参数设置为正确的/错误的批准/拒绝评论,并且使用全局变量,如$comment_ID,访问关于这个评论的信息。
pre_comment_content
applied to the content of a comment prior to saving the comment in the database.
pre_comment_content
应用到评论内容,再保存到数据库。
preprocess_comment
applied to the comment data prior to any other processing, when saving a new comment in the database. Function arguments: comment data array, with indices "comment_post_ID", "comment_author", "comment_author_email", "comment_author_url", "comment_content", "comment_type", and "user_ID".
preprocess_comment
在数据库中保存新评论的时候,应用到评论数据,然后再做其它处理。Function arguments: 评论数据数组, 拥有索引 "comment_post_ID", "comment_author", "comment_author_email", "comment_author_url", "comment_content", "comment_type", 和"user_ID"。

Category Filters[ ]

类别 Filters[ ]

See also [[WordPress:#Administrative Filters]] below. 也看看下面的[[WordPress:#Administrative Filters|#管理Filters]]。

Database Reads[ ]

Database Reads[ ]

Filters in this section are applied to information read from the database, prior to displaying on a page or editing screen.

这个部分的filteres应用到从数据库中读出,但是还没有在网页或者编辑界面上显示的信息。

category_description
applied to the "description" field categories by the category_description and wp_list_categories functions. Filter function arguments: description, category ID when called from category_description; description, category information array (all fields from the category table for that particular category) when called from wp_list_categories (sorry, but that's how it is).
category_description
应用到category_descriptionwp_list_categories函数的"描述"栏类别。Filter function arguments:从category_description调用时的描述,类别ID;从wp_list_categories调用时,描述,类别信息数组(类别表格中关于那个类别的所有栏)(对不起,但就是这样的)。
category_feed_link
applied to the feed URL generated for the category feed by the get_category_rss_link function.
category_feed_link
应用到为get_category_rss_link函数的类别feed而创建的feed URL。
category_link
applied to the URL created for a category by the get_category_link function. Filter function arguments: link URL, category ID.
category_link
应用到get_category_link函数的类别的URL。Filter function arguments: 链接 URL, 类别 ID。
get_categories
applied to the category list generated by the get_categories function (which is in turn used by many other functions). Filter function arguments: category list, get_categories options list.
get_categories
应用到get_categories函数产生的类别列表(许多其它函数依次使用)。Filter function arguments:类别列表,get_categories选项列表。
get_category
applied to the category information that the get_category function looks up, which is basically an array of all the fields in WordPress's category table for a particular category ID.
get_category
应用到get_category函数查找的类别信息,基本是WordPress类别表格,关于某个类别ID的所有栏。
list_cats
called for two different purposes:
list_cats
根据两个不同的目的调用:
  1. the wp_dropdown_categories function uses it to filter the show_option_all and show_option_none arguments (which are used to put options "All" and "None" in category drop-down lists). No additional filter function arguments.
  1. wp_dropdown_categories函数使用它来过滤show_option_allshow_option_none参数(用来将"所有的" 和"无"选项放到类别下拉列表上)没有额外的filter function arguments。
  1. the wp_list_categories function applies it to the category names. Filter function arguments: category name, category information list (all fields from the category table for that particular category).
  1. wp_list_categories函数将其应用到类别名。Filter function arguments:类别名,类别信息列表(类别表格中关于那个类别的所有栏)。
list_cats_exclusions
applied to the SQL WHERE statement giving the categories to be excluded by the get_categories function. Typically, a plugin would add to this list, in order to exclude certain categories or groups of categories from category lists. Filter function arguments: excluded category WHERE clause, get_categories options list.
list_cats_exclusions
应用到SQL,声明提供由get_categories函数删除的类别。一般来说,插件会添加到这个列表,从类别列表中删除某个类别或者某组类别。Filter function arguments: excluded category WHERE clause, get_categories 选项列表。
single_cat_title
applied to the category name when used to create a blog page title by the wp_title and single_cat_title functions.
single_cat_title
wp_titlesingle_cat_title函数创建博客网页标题的时候,应用到博客名。
the_category
applied to the list of categories (an HTML list with links) created by the get_the_category_list function. Filter function arguments: generated HTML text, list separator being used (empty string means it is a default LI list), parents argument to get_the_category_list.
the_category
应用到类别列表(拥有链接的HTML列表),由get_the_category_list函数创建。Filter function arguments:产生的HTML文本,使用的列表分隔符(空字符串,表示是默认LI列表),parents argument到get_the_category_list
the_category_rss
applied to the category list (a list of category XML elements) for a post by the get_the_category_rss function, before including in an RSS feed. Filter function arguments are the list text and the type ("rdf" or "rss" generally).
the_category_rss
get_the_category_rss函数应用到文章的类别列表(类别XML元素的列表),然后再包含到RSS feed。Filter function arguments作为列表文本和类型(一般为"rdf" 或者"rss")。
wp_dropdown_cats
applied to the drop-down category list (a text string containing HTML option elements) generated by the wp_dropdown_categories function.
wp_dropdown_cats
应用到wp_dropdown_categories函数创建的下拉类别列表(包含HTML选项元素的文本字符串)
wp_list_categories
applied to the category list (an HTML list) generated by the wp_list_categories function.
wp_list_categories
应用到wp_list_categories函数创建的类别列表(HTML列表)

Database Writes[ ]

数据库 Writes[ ]

Filters in this section are applied to information prior to saving to the database.

这个部分的Filters应用到还没有保存到数据库的信息中。

pre_category_description
applied to the category desription prior to saving in the database.
pre_category_description
应用到类别描述,然后保存到数据库。
pre_category_name
applied to the category name prior to saving in the database.
pre_category_name
应用到还没有保存到数据库的类别名。
pre_category_nicename
applied to the category nice name prior to saving in the database.
pre_category_nicename
应用到还没有保存到数据库的类别昵称。

Link Filters[ ]

链接 Filters[ ]

Note: This section contains filters related to links to posts, pages, archives, feeds, etc. For blogroll links, see the [[WordPress:#Blogroll Filters]] section below.

注:这个部分包含了文章,网页,归档,feed等等的链接相关的filters。关于友情链接,请看看下面的[[WordPress:#Blogroll Filters|#友情链接Filters]]部分。

attachment_link
applied to the calculated attachment permalink by the get_attachment_link function. Filter function arguments: link URL, attachment ID.
attachment_link
应用到get_attachment_link函数的calculated attachment permalink。Filter function arguments: l链接URL, attachment ID。
author_feed_link
applied to the feed URL generated for the author feed by the get_author_rss_link function.
author_feed_link
get_author_rss_link函数应用到,为作者feed创建的feed URL。
author_link
applied to the author's archive permalink created by the get_author_posts_url function. Filter function arguments: link URL, author's "nice" name, author ID. Note that get_author_posts_url is called within functions wp_list_authors and the_author_posts_link.
author_link
应用到get_author_posts_url函数创建的作者的归档permalink。Filter function arguments:链接URL,作者的"昵称",作者ID。注意get_author_posts_url是从函数wp_list_authorsthe_author_posts_link内部调用的。
day_link
applied to the link URL for a daily archive by the get_day_link function. Filter function arguments: URL, year, month number, day number.
day_link
应用到get_day_link函数每日归档的链接URL。Filter function arguments:URL,年,月,日。
feed_link
applied to the link URL for a feed by the get_feed_link function. Filter function arguments: URL, type of feed (e.g. "rss2", "atom", etc.).
feed_link
get_feed_link函数应用到feed的链接URL。Filter function arguments: URL, feed 的类型(例如 "rss2", "atom", 等等)。
get_comment_author_link
applied to the HTML generated for the author's link on a comment, in the get_comment_author_link function (which is also called by comment_author_link.
get_comment_author_link
应用到评论上作者链接的HTML,在get_comment_author_link函数中(也由comment_author_link调用。
get_comment_author_url_link
applied to the HTML generated for the author's lnik on a comment, in the get_comment_author_url_link function (which is also called by comment_author_link).
get_comment_author_url_link
应用到get_comment_author_url_link函数中,评论上作者链接的HTML。(也由comment_author_link调用)。
month_link
applied to the link URL for a monthly archive by the get_month_link function. Filter function arguments: URL, year, month number.
month_link
应用到get_month_link函数创建的每月归档的链接URL。Filter function arguments: URL, 年,月。
page_link
applied to the calculated page URL by the get_page_link function. Filter function arguments: URL, page ID. Note that there is also an internal filter called _get_page_link that can be used to filter the URLS of pages that are not designated as the blog's home page (same arguments).
page_link
应用到get_page_link函数计算出的网页URL。Filter function arguments: URL, 网页 ID。注意,也有个称为_get_page_link的内部filter,可以用来过滤网页URLS,不指定这些URLS作为博客的主页(同样的参数)。
post_link
applied to the calculated post permalink by the get_permalink function, which is also called by the the_permalink, post_permalink, previous_post_link, and next_post_link functions. Filter function arguments: permalink URL, post data list.
post_link
应用到get_permalink函数计算的文章permalink,也由tt>the_permalink, post_permalink, previous_post_link, 和next_post_link函数调用。Filter function arguments: permalink URL,文章数据列表。
the_permalink
applied to the permalink URL for a post prior to printing by function the_permalink.
the_permalink
应用到文章permalinkURL,再由the_permalink函数印出。
year_link
applied to the link URL for a yearly archive by the get_year_link function. Filter function arguments: URL, year.
year_link
应用到get_year_link函数按年归档的链接URL。Filter function arguments: URL, 年。

Date and Time Filters[ ]

日期和时间lters[ ]

See also [[WordPress:#Link Filters]] above. 也看看上面的[[WordPress:#Link Filters|#链接Filters]]

get_comment_date
applied to the formatted comment date generated by the get_comment_date function (which is also called by comment_date).
get_comment_date
应用到get_comment_date函数创建的格式化评论日期(也由comment_date调用)。
get_comment_time
applied to the formatted comment time in the get_comment_time function (which is also called by comment_time).
get_comment_time
应用到get_comment_time函数中的格式化评论时间(也由comment_time调用)。
get_the_modified_date
applied to the formatted post modification date generated by the get_the_modified_date function (which is also called by the the_modified_date function).
get_the_modified_date
应用到get_the_modified_date函数创建的格式化文章更改日期。(也由the_modified_date函数调用)。
get_the_modified_time
applied to the formatted post modification time generated by the get_the_modified_time and get_post_modified_time functions (which are also called by the the_modified_time function).
get_the_modified_time
应用到get_the_modified_timeget_post_modified_time函数创建的格式化文章更改时间(也由the_modified_time函数调用)。
get_the_time
applied to the formatted post time generated by the get_the_time and get_post_time functions (which are also called by the the_time function).
get_the_time
应用到get_the_timeget_post_time函数创建的格式化文章时间(也由the_time函数调用)。
the_date
applied to the formatted post date generated by the the_date function.
the_date
应用到the_date函数创建的格式化文章日期。
the_modified_date
applied to the formatted post modification date generated by the the_modified_date function.
the_modified_date
应用到the_modified_date函数创建的格式化文章更改日期。
the_modified_time
applied to the formatted post modification time generated by the the_modified_time function.
the_modified_time
应用到the_modified_time函数创建的格式化文章更改时间。
the_time
applied to the formatted post time generated by the the_time function.
the_time
应用到the_time函数创建的格式化文章时间。
the_weekday
applied to the post date weekday name generated by the the_weekday function.
the_weekday
应用到the_weekday函数创建的文章日期星期名。
the_weekday_date
applied to the post date weekday name generated by the the_weekday_date function. Function arguments are the weekday name, before text, and after text (before text and after text are added to the weekday name if the current post's weekday is different from the previous post's weekday).
the_weekday_date
应用到the_weekday_date函数创建的文章日期星期名。Function arguments是星期名,在文本前后(如果当前文章的星期名与前一篇文章的星期名不同,文本前后添加到星期名。

Author and User Filters[ ]

作者和用户Filters[ ]

See also [[WordPress:#Link Filters]] and [[WordPress:#Administrative Filters]] sections.

也看看[[WordPress:#Link Filters|#链接Filters]]和[[WordPress:#Administrative Filters|#管理Filters]]部分。

Database Reads[ ]

数据库Reads[ ]

Filters in this section are applied to information read from the database, prior to displaying on a page or editing screen.

这个部分的Filters应用到从数据库中读出,还没有在网页或者编辑界面上显示的信息。

author_email
applied to the comment author's email address retrieved from the database by the comment_author_email function. See also get_comment_author_email.
author_email
应用到comment_author_email函数,从数据库中返回的评论作者的电子邮件地址。也看看get_comment_author_email
comment_author
applied to the comment author's name retrieved from the database by the comment_author function. See also get_comment_author.
comment_author
应用到comment_author函数从数据库中返回的评论作者姓名。也看看get_comment_author
comment_author_rss
applied to the comment author's name prior to including in an RSS feed.
comment_author_rss
应用到评论作者的姓名,再保存到RSS feed。
comment_email
applied to the comment author's email address retrieved from the database by the comment_author_email_link function.
comment_email
应用到comment_author_email_link函数从数据库中返回的评论作者的电子邮件地址。
comment_url
applied to the comment author's URL retrieved from the database by the comment_author_url function (see also get_comment_author_url).
comment_url
应用到comment_author_url函数从数据库中返回的评论作者的URL(也看看get_comment_author_url)。
get_comment_author
applied to the comment author's name retrieved from the database by get_comment_author, which is also called by comment_author. See also comment_author.
get_comment_author
应用到get_comment_author从数据库中返回的评论作者的姓名,也由comment_author调用。也看看comment_author
get_comment_author_email
applied to the comment author's email address retrieved from the database by get_comment_author_email, which is also called by comment_author_email. See also author_email.
get_comment_author_email
应用到get_comment_author_email从数据库中返回的评论作者的电子邮件地址,也由comment_author_email调用。也看看author_email
get_comment_author_IP
applied to the comment author's IP address retrieved from the database by the get_comment_author_IP function, which is also called by comment_author_IP.
get_comment_author_IP
应用到get_comment_author_IP函数从数据库中返回的评论作者的IP地址,也由comment_author_IP调用。
get_comment_author_url
applied to the comment author's URL retrieved from the database by the get_comment_author_url function, which is also called by comment_author_url. See also comment_url.
get_comment_author_url
应用到get_comment_author_url函数从数据库中返回的评论作者的URL,也由comment_author_url调用。也看看comment_url
login_errors
applied to the login error message printed on the login screen.
login_errors
应用到登录界面上的登录错误信息。
login_headertitle
applied to the title for the login header URL (Powered by WordPress by default) printed on the login screen.
login_headertitle
应用到登录界面上的登录标头URL的标题(默认WordPress推动)。
login_headerurl
applied to the login header URL (points to wordpress.org by default) printed on the login screen.
login_headerurl
应用到登录界面上的登录标头URL(默认指向wordpress.org)。
login_message
applied to the login message printed on the login screen.
login_message
应用到登录界面印出的登录信息。
role_has_cap
applied to a role's capabilities list in the WP_Role->has_cap function. Filter function arguments are the capabilities list to be filtered, the capability being questioned, and the role's name.
role_has_cap
应用到WP_Role->has_cap函数中的功能权限列表。Filter function arguments是需要过滤的权限列表,权限需要查询,以及角色名。
sanitize_user
applied to a user name by the sanitize_user function. Filter function arguments: user name (after some cleaning up), raw user name, strict (true or false to use strict ASCII or not).
sanitize_user
sanitize_user函数应用到用户名。Filter function arguments: 用户名(做一些清除后),简略的用户名,严格地 (正确的或者错误的是否使用严格地ASCII)。
the_author
applied to a post author's displayed name by the get_the_author function, which is also called by the the_author function.
the_author
get_the_author函数应用到文章作者显示名,也由the_author函数调用。
the_author_email
applied to a post author's email address by the the_author_email function.
the_author_email
the_author_email函数应用到文章作者的电子邮件地址。

Database Writes[ ]

数据库Writes[ ]

Filters in this section are applied to information prior to saving to the database.

这个部分的filters应用到信息,然后再保存到数据库。

pre_comment_author_email
applied to a comment author's email address prior to saving the comment in the database.
pre_comment_author_email
应用到评论作者的电子邮件地址,然后再将评论保存到数据库。
pre_comment_author_name
applied to a comment author's user name prior to saving the comment in the database.
pre_comment_author_name
应用到评论作者的用户名,然后再将评论保存到数据库。
pre_comment_author_url
applied to a comment author's URL prior to saving the comment in the database.
pre_comment_author_url
应用到评论作者的URL,然后再将评论保存到数据库。
pre_comment_user_agent
applied to the comment author's user agent prior to saving the comment in the database.
pre_comment_user_agent
应用到评论作者的用户代理,然后再将评论保存到数据库。
pre_comment_user_ip
applied to the comment author's IP address prior to saving the comment in the database.
pre_comment_user_ip
应用到评论作者的IP地址,然后再将评论保存到数据库。
pre_user_id
applied to the comment author's user ID prior to saving the comment in the database.
pre_user_id
应用到评论作者的用户ID,然后再将评论保存到数据库。
pre_user_description
applied to the user's description prior to saving in the database.
pre_user_description
应用到用户的描述,然后再保存到数据库。
pre_user_display_name
applied to the user's displayed name prior to saving in the database.
pre_user_display_name
应用到用户的用户名,然后再保存到数据库。
pre_user_email
applied to the user's email address prior to saving in the database.
pre_user_email
应用到用户的电子邮件地址,然后再保存到数据库。
pre_user_first_name
applied to the user's first name prior to saving in the database.
pre_user_first_name
应用到用户的名字,然后再保存到数据库。
pre_user_last_name
applied to the user's last name prior to saving in the database.
pre_user_last_name
应用到用户的姓,然后再保存到数据库。
pre_user_login
applied to the user's login name prior to saving in the database.
pre_user_login
应用到用户的登录名,然后再保存到数据库。
pre_user_nicename
applied to the user's "nice name" prior to saving in the database.
pre_user_nicename
应用到用户的"昵称",然后再保存到数据库。
pre_user_nickname
applied to the user's nickname prior to saving in the database.
pre_user_nickname
应用到用户的昵称,然后再保存到数据库。
pre_user_url
applied to the user's URL prior to saving in the database.
pre_user_url
应用到用户的URL,然后再保存到数据库。
registration_errors
applied to the list of registration errors generated while registering a user for a new account.
registration_errors
应用到为新帐户注册用户时,产生的注册错误列表上。
user_registration_email
applied to the user's email address read from the registration page, prior to trying to register the person as a new user.
user_registration_email
应用到注册网页上列出的用户电子邮件地址,然后再注册新用户。
validate_username
applied to the validation result on a new user name. Filter function arguments: valid (true/false), user name being validated.
validate_username
应用到新的用户名的确认结果中。Filter function arguments:有效的(正确的/错误的),正在确认的用户名。

Blogroll Filters[ ]

友情链接 Filters[ ]

Note: This section contains filters related to blogroll links. For filters related to links to posts, pages, categories, etc., see section [[WordPress:#Link Filters]] above.

注:这个部分包含了友情链接相关的filters。关于文章,网页,类别等等的链接相关的filters,请看看上面的[[WordPress:#Link Filters|#链接Filters]]部分。

get_bookmarks
applied to link/blogroll database query results by the get_bookmarks function. Filter function arguments: database query results list, get_bookmarks arguments list.
get_bookmarks
应用到get_bookmarks函数的链接/友情链接数据库查询结果。Filter function arguments:数据库查询结果列表,get_bookmarks参数列表。
link_category
applied to the link category by the get_links_list and wp_list_bookmarks functions (as of WordPress 2.2).
link_category
应用到get_links_listwp_list_bookmarks函数的链接类别(从WordPress2.2开始)。
link_description
applied to the link description by the get_links and wp_list_bookmarks functions (as of WordPress 2.2).
link_description
应用到get_linkswp_list_bookmarks函数的链接描述(从WordPress2.2开始)。
link_rating
applied to the link rating number by the get_linkrating function.
link_rating
应用到get_linkrating函数的链接等级级别。
link_title
applied to the link title by the get_links and wp_list_bookmarks functions (as of WordPress 2.2)
link_title
get_linkswp_list_bookmarks函数,应用到链接标题(从WordPress2.2开始)
pre_link_description
applied to the link description prior to saving in the database.
pre_link_description
应用到链接描述,然后保存到数据库。
pre_link_image
applied to the link image prior to saving in the database.
pre_link_image
应用到链接图像,然后保存到数据库。
pre_link_name
applied to the link name prior to saving in the database.
pre_link_name
应用到链接名,然后保存到数据库。
pre_link_notes
applied to the link notes prior to saving in the database.
pre_link_notes
应用到链接注释,然后保存到数据库。
pre_link_rel
applied to the link relation information prior to saving in the database.
pre_link_rel
应用到链接相关信息,然后保存到数据库。
pre_link_rss
applied to the link RSS URL prior to saving in the database.
pre_link_rss
应用到链接RSS URL,然后保存到数据库。
pre_link_target
applied to the link target information prior to saving in the database.
pre_link_target
应用到链接target信息,然后保存到数据库。
pre_link_url
applied to the link URL prior to saving in the database.
pre_link_url
应用到链接URL,然后保存到数据库。

Blog Information and Option Filters[ ]

博客信息和选项 Filters[ ]

all_options
applied to the option list retrieved from the database by the get_alloptions function.
all_options
应用到get_alloptions函数从数据库中返回的选项列表。
bloginfo
applied to the blog option information retrieved from the database by the bloginfo function, after first retrieving the information with the get_bloginfo function. A second argument $show gives the name of the bloginfo option that was requested. Note that bloginfo("url"), bloginfo("directory") and bloginfo("home") do not use this filtering function (see bloginfo_url).
bloginfo
get_bloginfo函数返回信息后,运用到bloginfo函数从数据库中返回的博客选项信息。第二个参数$show提供了需求的博客信息选项。注意bloginfo("url"), bloginfo("directory")bloginfo("home")使用这个filtering函数(请看看bloginfo_url)。
bloginfo_rss
applied to the blog option information by function get_bloginfo_rss (which is also called from bloginfo_rss), after first retrieving the information with the get_bloginfo function, stripping out HTML tags, and converting characters appropriately. A second argument $show gives the name of the bloginfo option that was requested.
bloginfo_rss
使用get_bloginfo函数返回信息,去除HTML标签,并且适当地转换了字符后,由get_bloginfo_rss函数应用到博客选项信息。第二个参数提供了请求的博客信息选项的名称。
bloginfo_url
applied to the the output of bloginfo("url"), bloginfo("directory") and bloginfo("home") before returning the information.
bloginfo_url
应用到bloginfo("url"), bloginfo("directory")bloginfo("home")的输出,然后再返回信息。
loginout
applied to the HTML link for logging in and out (generally placed in the sidebar) generated by the wp_loginout function.
loginout
wp_loginout函数创建的登录和退出(一般放置在边栏),应用到HTML链接。
option_(option name)
applied to the option value retrieved from the database by the get_option function, after unserializing (which decodes array-based options). To use this filter, you will need to add filters for specific options names, such as "option_foo" to filter the output of get_option("foo").
option_(option name)
unserializing后(解码了以数组为基础的选项),应用到数据库返回的选项参数值。要使用这个filter,你需要为特别的选项名称添加filters,如"option_foo" filterget_option("foo")的输出。
pre_option_(option name)
applied to the option value retrieved from the database by the get_alloptions function, after unserializing (which decodes array-based options). To use this filter, you will need to add filters for specific options names, such as "pre_option_foo" to filter the option "foo".
pre_option_(选项名):unserializing后(解码了以数组为基础的选项),应用到由get_alloptions函数从数据库返回的选项参数值。要使用这个filter,你需要为特别的选项名称添加filters,如"pre_option_foo"过滤选项"foo"。
register
applied to the sidebar link created for the user to register (if allowed) or visit the admin panels (if already logged in) by the wp_register function.
register
应用到为用户注册创建的边栏链接(如果允许的话)或者由wp_register函数访问管理面板(如果已经登录)。
upload_dir
applied to the directory to be used for uploads calculated by the wp_upload_dir function. Filter function argument is an array with components "dir" (the upload directory path), "url" (the URL of the upload directory), and "error" (which you can set to true if you want to generate an error).
upload_dir
用于wp_upload_dir函数计算的用于上传的目录。Filter function参数是带有"dir"组成部分的数组(上传目录路径),"url"(上传目录URL),和"错误"(如果你想要创建错误,你可以设置为正确的)。
upload_mimes
allows a filter function to return a list of MIME types for uploads, if there is no MIME list input to the wp_check_filetype function. Filter function argument is an associated list of MIME types whose component names are file extensions (separated by vertical bars) and values are the corresponding MIME types.
upload_mimes
如果wp_check_filetype函数中没有输入MIME列表,允许filter function返回用于上传的MIME类型。Filter function argument是MIME类型的联合列表,组成名是文章扩展名(由竖线分开)和MIME类型响应的参数值。

General Text Filters[ ]

一般的文本Filters[ ]

attribute_escape
applied to post text and other content by the attribute_escape function, which is called in many places in WordPress to change certain characters into HTML attributes before sending to the browser.
attribute_escape
attribute_escape函数应用到文章文本和其它内容,WordPress在许多时候,都会调用这个函数,将某些字符更改为HTML属性,再发送到浏览器。
js_escape
applied to JavaScript code before sending to the browser in the js_escape function.
js_escape
应用到JavaScript代码,在发送到js_escape函数中的浏览器。

Administrative Filters[ ]

管理 Filters[ ]

The filters in this section are related to the administration screens of WordPress, including content editing screens.

这个部分的filters与WordPress管理界面相关,包括内容编辑界面。

autosave_interval
applied to the interval for auto-saving posts.
autosave_interval
应用到自动保存的文章的时间间隔。
cat_rows
applied to the category rows HTML generated for managing categories in the admin menus.
cat_rows
应用到管理菜单管理类别中产生的HTML类别rows。
comment_edit_pre
applied to comment content prior to display in the editing screen.
comment_edit_pre
应用到评论内容,再显示到编辑界面。
comment_edit_redirect
applied to the redirect location after someone edits a comment in the admin menus. Filter function arguments: redirect location, comment ID.
comment_edit_redirect
有人在管理界面中编辑评论之后,应用到redirect位置。Filter function arguments: redirect location, 评论ID。
comment_moderation_subject
applied to the mail subject before sending email notifying the administrator of the need to moderate a new comment. Filter function arguments: mail subject, comment ID. Note that this happens inside the default wp_notify_moderator function, which is a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
comment_moderation_subject
向管理员发送电子邮件,要求审核新评论之前,应用到邮件主题。Filter function arguments:邮件主题,评论ID。注意这在默认wp_notify_moderator函数内发生,是个"pluggable"函数,意思是插件可以取代这个函数;请看看插件API)。
comment_moderation_text
applied to the body of the mail message before sending email notifying the administrator of the need to moderate a new comment. Filter function arguments: mail body text, comment ID. Note that this happens inside the default wp_notify_moderator function, which is a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
comment_moderation_text
向管理员发送电子邮件,要求审核新评论之前,应用到邮件内容。Filter function arguments:邮件内容文本,评论ID。注意这在默认wp_notify_moderator函数内发生,是个"pluggable"函数,意思是插件可以取代这个函数;请看看插件API
comment_moderation_text
comment_moderation_text
comment_notification_headers
applied to the mail headers before sending email notifying the post author of a new comment. Filter function arguments: mail header text, comment ID. Note that this happens inside the default wp_notify_postauthor function, which is a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
comment_notification_headers
向管理员发送电子邮件,要求审核新评论之前,应用到邮件标头。Filter function arguments:邮件标头文本,评论ID。注意这在默认wp_notify_postauthor函数内发生,是个"pluggable"函数,意思是插件可以取代这个函数;请看看插件API
comment_notification_subject
applied to the mail subject before sending email notifying the post author of a new comment. Filter function arguments: mail subject, comment ID. Note that this happens inside the default wp_notify_postauthor function, which is a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
comment_notification_subject
向文章作者发送电子邮件,提醒有新评论之前,应用到邮件主题。Filter function arguments:邮件主题,评论ID。注意这在默认wp_notify_postauthor函数内发生,是个"pluggable"函数,意思是插件可以取代这个函数;请看看插件API)。
comment_notification_text
applied to the body of the mail message before sending email notifying the post author of a new comment. Filter function arguments: mail body text, comment ID. Note that this happens inside the default wp_notify_postauthor function, which is a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
comment_notification_text
向文章作者发送电子邮件,提醒有新评论之前,应用到邮件信息主体部分。Filter function arguments:邮件主体文本,评论ID。注意这在默认wp_notify_postauthor函数内发生,是个"pluggable"函数,意思是插件可以取代这个函数;请看看插件API)。
cron_schedules
applied to an empty array to allow a plugin to generate cron schedules in the wp_get_schedules function.
cron_schedules
应用到空数组,使得插件能够在wp_get_schedules函数中创建cron schedules。
default_content
applied to the default post content prior to opening the editor for a new post.
default_content
应用到默认文章内容,再为新文章打开编辑器。
default_excerpt
applied to the default post excerpt prior to opening the editor for a new post.
default_excerpt
应用到默认文章摘录,再为新文章打开编辑器。
default_title
applied to the default post title prior to opening the editor for a new post.
default_title
应用到默认文章标题,再为新文章打开编辑器。
format_to_edit
applied to comment content, author name, author email, and author URL by the format_to_edit function, which is called by the admin menus to set up a comment for editing. Also applied to when editing posts in the admin menus.
format_to_edit
format_to_edit函数应用到评论内容,作者名,作者电子邮件和作者URL,函数由管理界面菜单调用,设置评论,用于编辑。在管理菜单中编辑文章的时候,也适用。
explain_nonce_(verb)-(noun)
allows a filter function to define text to be used to explain a nonce that is otherwise not explained by the WordPress core code. You will need to define specific verb/noun filters to use this. For instance, if your plugin defines a nonce for updating a tag, you would define a filter for "explain_nonce_update-tag". Filter function arguments: text to display (defaults to a generic "Are you sure you want to do this?" message) and extra information from the end of the action URL. In the example here, your function might simply return the string "Are you sure you want to update this tag?".
explain_nonce_(verb)-(noun)
允许filter function定义文本解释nonce,否则WordPress核心代码就不解释nonce。你需要定义特别的动词/名词使用nonce。例如,如果你的插件定义nonce来更新标签,你就要为"explain_nonce_update-tag"定义filter。Filter function arguments:要显示的文本(默认为一般的"你确定要这样做吗?" 信息)和action URL结尾部分的额外信息。在这里的例子中,你的函数可能只返回字符串"你确定要更新这个标签吗?"。
format_to_edit
applied to post content, excerpt, title, and password by the format_to_edit function, which is called by the admin menus to set up a post for editing. Also applied to when editing comments in the admin menus.
format_to_edit
format_to_edit函数,应用到文章内容,摘录,标题和密码,函数由管理界面调用,设置文章来编辑。在管理菜单中编辑文章的时候,也适用。
format_to_post
applied to post content by the format_to_post function, which is not used in WordPress by default.
format_to_post
format_to_post函数应用到文章内容,默认情况下,WordPress不使用这个函数。
manage_link_columns
applied to the list of columns to print on the blogroll management screen. Filter function argument/return value is an associative list where the element key is the name of the column, and the value is the header text for that column. See also action manage_link_custom_column, which puts the column information into the edit screen.
manage_link_columns
应用到栏列表,印到友情链接管理界面。Filter function argument/返回值是个相关列表,element key是栏名称,参数值是栏的标头文本。也看看action manage_link_custom_column,将栏信息放在了编辑界面。
manage_posts_columns
applied to the list of columns to print on the manage posts screen. Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column. See also action manage_posts_custom_column, which puts the column information into the edit screen. (see Scompt's tutorial for examples and use.)
manage_posts_columns
应用到栏列表,印到管理文章界面。Filter function argument/返回值是个相关列表,element key是栏名称,参数值是栏的标头文本。也看看action manage_link_custom_column,将栏信息放在了编辑界面。(看看Scompt's tutorial 中的例子和用法。)
manage_pages_columns
applied to the list of columns to print on the manage pages screen. Filter function argument/return value is an associative array where the element key is the name of the column, and the value is the header text for that column. See also action manage_pages_custom_column, which puts the column information into the edit screen.
manage_pages_columns
应用到栏列表,发表到管理网页界面。Filter function argument/返回值是个相关列表,element key是栏名称,参数值是栏的标头文本。也看看action manage_link_custom_column,将栏信息放在了编辑界面。
postmeta_form_limit
applied to the number of post-meta information items shown on the post edit screen.
postmeta_form_limit
应用到文章编辑界面上显示的post-meta 信息内容显示的数目。
pre_upload_error
applied to allow a plugin to create an XMLRPC error for uploading files.
pre_upload_error
应用,使得插件能够创建XMLRPC错误,更新文件。
preview_page_link
applied to the link on the page editing screen that shows the page preview at the bottom of the screen.
preview_page_link
应用到在界面的底部显示网页预览的网页编辑界面上的链接上。
preview_post_link
applied to the link on the post editing screen that shows the post preview at the bottom of the screen.
preview_post_link
应用到在界面的底部显示文章预览的文章编辑界面上的链接上。
richedit_pre
applied to post content by the wp_richedit_pre function, before displaying in the rich text editor.
richedit_pre
wp_richedit_pre函数应用到文章内容,再在多功能的文本编辑器上显示。
show_password_fields
applied to the true/false variable that controls whether the user is presented with the opportunity to change their password on the user profile screen (true means to show password changing fields; false means don't).
show_password_fields
应用到正确的/错误的变数,这个变数控制了用户是否有机会更改用户基本资料界面上的密码(正确的,指的是显示密码更改栏;错误的意思是不显示)。
the_editor
applied to the HTML DIV created to house the rich text editor, prior to printing it on the screen.
the_editor
应用到创建的HTML DIV中,用于放入多功能的文本编辑器,然后再在界面上发表。
user_can_richedit
applied to the calculation of whether the user's browser has rich editing capabilities, and whether the user wants to use the rich editor, in the user_can_richedit function. Filter function argument and return value is true/false if the current user can/cannot use the rich editor.
user_can_richedit
用来考虑在user_can_richedit函数中,用户的浏览器是否有丰富的编辑功能,用户是否想要使用丰富的编辑器。如果当前用户能够/不能够使用多功能编辑器,Filter function argument 和返回参数值是正确的/错误的。
user_has_cap
applied to a user's capabilities list in the WP_User->has_cap function (which is called by the current_user_can function). Filter function arguments are the capabilities list to be filtered, the capability being questioned, and the argument list (which has things such as the post ID if the capability is to edit posts, etc.)
user_has_cap
应用到WP_User->has_cap函数中的用户功能列表(也由current_user_can函数调用)。Filter function arguments是需要过滤的功能列表,需要查询的功能,和参数列表(如果功能是要编辑文章,等等,就有如,文章ID)
wp_handle_upload
applied to the upload information when uploading a file. Filter function argument: array with elements "file" (file name), "url", "type".
wp_handle_upload
上传文件时,应用到上传信息。Filter function argument:拥有"文件"的数组(文件名),"url", "类型"。
wp_upload_tabs
applied to the list of custom tabs to display on the upload management admin screen. Use action upload_files_(tab) to display a page for your custom tab (see WordPress:Plugin API/Action Reference).
wp_upload_tabs
应用到自定义标签列表,显示在上传管理界面。使用action upload_files_(tab)为你自定义的标签显示页面(请看看 Plugin API/Action Reference)。

Rich Text Editor Filters[ ]

多功能文本编辑器Filters[ ]

These filters modify the configuration of the rich text editor.

这些filters更改了多功能文本编辑器的配置。

mce_spellchecker_languages
applied to the language selection available in the spell checker.
mce_spellchecker_languages
应用到拼写检查程序中的语言选择中。
mce_buttons, mce_buttons_2, mce_buttons_3, mce_buttons_4
applied to the rows of buttons for the rich editor toolbar (each is an array of button names).
mce_buttons, mce_buttons_2, mce_buttons_3, mce_buttons_4
应用到多功能编辑器工具条上的按钮(每个都是一组按钮名)。
mce_css
applied to the CSS file URL for the rich text editor.
mce_css
应用到丰富文本编辑器中的CSS文件的URL上。
mce_external_plugins
applied to the array of external plugins to be loaded by the rich text editor.
mce_external_plugins
应用到多功能文本编辑器载入的外部插件。
mce_external_languages
applied to the array of language files loaded by external plugins, allowing them to use the standard translation method (see tinymce/langs/wp-langs.php for reference).
mce_external_languages
应用到外部插件载入的语言文件,使得这些文件使用标准的翻译方法(请参考tinymce/langs/wp-langs.php)。
tiny_mce_before_init
applied to the whole init array for the editor.
tiny_mce_before_init
应用到编辑器的整个init数组。

Template Filters[ ]

模板 Filters[ ]

This section contains links related to themes, templates, and style files.

这个部分包含了主题,模板,和样式文件相关的链接。

kubrick_header_color
applied to the color for the header of the default theme.
kubrick_header_color
应用于默认主题标头的颜色。
kubrick_header_display
applied to the display option for the header of the default theme.
kubrick_header_display
应用于默认主题标头的显示选项。
kubrick_header_image
applied to the header image file for the default theme.
kubrick_header_image
应用于默认主题标头图像文件。
locale_stylesheet_uri
applied to the locale-specific stylesheet URI returned by the get_locale_stylesheet_uri function. Filter function arguments: URI, stylesheet directory URI.
locale_stylesheet_uri
应用到get_locale_stylesheet_uri函数返回的locale-specific样式表URI。Filter function arguments: URI,样式表目录URI。
stylesheet
applied to the stylesheet returned by the get_stylesheet function.
stylesheet
应用到get_stylesheet函数返回的样式表。
stylesheet_directory
applied to the stylesheet directory returned by the get_stylesheet_directory function. Filter function arguments: stylesheet directory, stylesheet.
stylesheet_directory
应用到get_stylesheet_directory函数返回的样式表目录。Filter function arguments: 样式表目录,样式表。
stylesheet_directory_uri
applied to the stylesheet directory URI returned by the get_stylesheet_directory_uri function. Filter function arguments: stylesheet directory URI, stylesheet.
stylesheet_directory_uri
应用到get_stylesheet_directory_uri函数返回的样式表目录URI。Filter function arguments: 样式表目录URI,样式表。
stylesheet_uri
applied to the stylesheet URI returned by the get_stylesheet_uri function. Filter function arguments: stylesheet URI, stylesheet.
stylesheet_uri
应用到get_stylesheet_uri函数返回的样式表URI。Filter function arguments:样式表URI,样式表。
template
applied to the template returned by the get_template function.

;模板:应用到get_template函数返回的模板。

template_directory
applied to the template directory returned by the get_template_directory function. Filter function arguments: template directory, template.
template_directory
应用到get_template_directory函数返回的模板目录。Filter function arguments:模板目录,模板。
template_directory_uri
applied to the template directory URI returned by the get_template_directory_uri function. Filter function arguments: template directory URI, template.
template_directory_uri
应用到get_template_directory_uri函数返回的模板目录URI。Filter function arguments:模板目录URI,模板。
theme_root
applied to the theme root directory (normally wp-content/themes) returned by the get_theme_root function.
theme_root
应用到get_theme_root函数返回的主题根目录(一般为wp-content/themes)。
theme_root_uri
applied to the theme root directory URI returned by the get_theme_root_uri function. Filter function arguments: URI, site URL.
theme_root_uri
应用到get_theme_root_uri函数返回的主题根目录URI。Filter function arguments:URI,站点URL。

You can also replace individual template files from your theme, by using the following filter hooks. See also the template_redirect action hook. Each of these filters takes as input the path to the corresponding template file in the current theme. A plugin can modify the file to be used by returning a new path to a template file.

通过使用下面的filter hooks,你也可以取代你的主题中单个的模板文件。也看看template_redirect action hook。每个filters都作为当前主题中的模板文件的相应的路径。插件通过返回模板文件的新路径,能够更改使用的文件。

404_template
archive_template
attachment_template
author_template
category_template
comments_popup_template
comments_template
date_template
home_template
page_template
paged_template
search_template
single_template




404_template
archive_template
attachment_template
author_template
category_template
comments_popup_template
comments_template
date_template
home_template
page_template
paged_template
search_template
single_template


Advanced WordPress Filters[ ]

WordPress高级的Filters[ ]

This section contains advanced filters related to the WordPress queries, rewrite rules, internationalization, and other fundamental WordPress functions.

这个部分包含了WordPress查询,rewrite规则,国际化,和其它WordPress基本的函数相关的高级filters。

author_rewrite_rules
applied to the author-related rewrite rules after they are generated.
author_rewrite_rules
规则创建后创建后,应用到作者相关的rewrite规则。
category_rewrite_rules
applied to the category-related rewrite rules after they are generated.
category_rewrite_rules
规则创建后,应用到类别相关的rewrite规则。
comments_rewrite_rules
applied to the comment-related rewrite rules after they are generated.
comments_rewrite_rules
规则创建后,应用到评论相关的rewrite规则。
create_user_query
applied to the query used to save a new user's information to the database, just prior to running the query.
create_user_query
在运行查询前,应用于将新用户信息保存到数据库的查询中。
date_rewrite_rules
applied to the date-related rewrite rules after they are generated.
date_rewrite_rules
创建后,用于日期相关的rewrite规则。
found_posts
applied to the list of posts, just after querying from the database.
found_posts
从数据库中查询后,用于文章列表。
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 SELECT FOUND_ROWS() at that step.
found_posts_query
显示的文章列表从数据库中查询之后,WordPress从查询结果中选饿几组。这个filter能够使你在这个步骤时,做一些其它事,而不是SELECT FOUND_ROWS()
get_editable_authors
applied to the list of post authors that the current user is authorized to edit in the get_editable_authors function.
get_editable_authors
应用到文章作者列表,当前用户能够在get_editable_authors函数中编辑。
gettext
applied to the translated text by the __ and _e 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 ___e国际化函数,应有到已翻译的文本。Filter function arguments:已翻译的文本和未翻译的文本。如果国际化有效,而且如果文本网页已经载入,就会得到应用。
get_next_post_join
in function get_next_post (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 get_next_post(找到当前显示的文章后面的文章),应用到SQL JOIN clause(如果用户浏览类别归档,一般进入类别表格)。Filter function arguments: JOIN clause,在同一个类别中(正确的/错误的),删除的类别列表。
get_next_post_sort
in function get_next_post (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
在函数get_next_post中,(找到当前显示的文章之后的文章),应用到SQL ORDER BY clause(一般限制按一篇文章日期的降序排列)。Filter function arguments: ORDER BY clause。
get_next_post_sort
get_next_post_sort
get_next_post_where
in function get_next_post (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
在函数get_next_post中,(找到当前显示的文章之后的文章),应用到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
应用到挑选其他用户的草稿放到管理菜单的查询中。
get_previous_post_join
in function get_previous_post (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
在函数get_previous_post中(找到当前显示的文章之前的文章),应用到SQL JOIN clause(如果用户正在阅读类别归档,一般会加入类别表格)。Filter function arguments: join clause,位于同一个类别 (正确的/错误的),已删除的类别列表。
get_previous_post_sort
in function get_previous_post (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
在函数get_previous_post中(找到当前显示的文章之前的文章),应用到SQL ORDER BY clause(一般限制为一篇文章的降序顺序)。Filter function arguments: ORDER BY clause。
get_previous_post_where
in function get_previous_post (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
在函数get_previous_post中找到当前显示的文章之前的文章),应用到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
应用到挑选用户的草稿显示到管理菜单的查询中。
locale
applied to the locale by the get_locale function.
locale
get_locale函数应用到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 rewrite_rules.)
mod_rewrite_rules
应用到用户更改permalink结构时,放入.htaccess文件中的rewrite规则。(注:取代已取消的filter rewrite_rules。)
post_limits
applied to the LIMIT clause of the query that returns the post array.
post_limits
应用到返回文章数组的查询的LIMIT clause。
posts_distinct
allows a plugin to add a DISTINCTROW clause to the query that returns the post array.
posts_distinct
允许插件将DISTINCTROW clause添加到返回文章数组的查询中。
posts_fields
applied to the field list for the query that returns the post array.
posts_fields
应用到返回文章数组的查询的field列表。
posts_groupby
applied to the GROUP BY clause of the query that returns the post array (normally empty).
posts_groupby
应用到返回文章数组(一般为空的)的查询的GROUP BY clause。
posts_join_paged
applied to the JOIN 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 posts_join).
posts_join_paged
计算好内存分页后(但是内存分页并不影响JOIN,因此这事实上与posts_join等同)应用到返回文章数组的查询的JOIN clause。
posts_orderby
applied to the ORDER BY clause of the query that returns the post array.
posts_orderby
应用到返回文章数组的查询的ORDER BY clause。
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
应用到规则产生后,与文章相关的rewrite规则。
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
rewrite规则产生后,应用到网页相关的rewrite规则。
posts_where_paged
applied to the WHERE 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 posts_where).
posts_where_paged
内存分页计算好后,应用到返回文章数组的查询的WHERE clause(但是内存分页不影响WHERE,因此这事实上与posts_where是对等的)。
posts_join
applied to the JOIN clause of the query that returns the post array. This is typically used to add a table to the JOIN, in combination with the posts_where filter.
posts_join
应用到返回文章数组的查询的JOIN clause。通常使用这个来给JOIN添加表格,与posts_where filter结合在一起。
posts_where
applied to the WHERE clause of the query that returns the post array.
posts_where
应用到返回文章数组的查询的WHERE clause。
query
applied to all queries (at least all queries run after plugins are loaded).
query
应用到所有查询(至少插件载入后,所有查询运行)。
query_string
deprecated - use query_vars or request instead.
query_string
已取消-使用query_vars或者request代替。
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 query_vars, but applied after "extra" and private query variables have been added.
request
query_vars,但是"extra"和保密查询变数添加后,应用。
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
创建后,应用到搜索相关的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
在单篇文章网页上处理权限和草稿状态后,应用到数据库中已查询的文章列表。
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
应用到HTML src 标签,文章和网页编辑界面上的更新结构。
wp_redirect
applied to a redirect URL by the default wp_redirect function. Filter function arguments: URL, HTTP status code. Note that wp_redierct is also a "pluggable" function, meaning that plugins can override it; see WordPress:Plugin API).
wp_redirect
由默认的wp_redirect函数应用到redirect URL。Filter function arguments: URL, HTTP status代码。注意wp_redierct也是个"pluggable"函数,指的是插件可以取代这个函数;请看看插件API。)
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
在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
wp_mail函数发送任何邮件之前,应用。Filter应该返回一个名称字符串,用在名称中的电子邮件。

Further Reading[ ]

深入阅读[ ]









  • 编写插件 – 描述怎样编写插件
  • 插件API – 关于怎样使用filters和actions的文章
  • 插件API/Action Reference - Action hooks的reference列表
  • 插件资源 – 插件相关的资源的全面列表
  • Skippy的列表 关于actions 和 filters
  • WordPress Hooks, 正在进行的工作,所有的WordPress hook的目录。
  • WordPress Hooks 数据库, 所有的WordPress hooks的数据库,显示来自哪个版本,链接到使用这些hooks的源代码站点。
  • Angsuman的列表, a comprehensive listing of WordPress action hooks 的完整列表,带有文档和源代码位置信息。包含了WordPress2.0中所有已归档和未归档的action hooks。