有朋自远方来,不亦乐乎。
wordpress常见的action钩子大全(六)
原创 橘子书  发布于 7个月前 ( 05-09 ) 阅读: 745 次 评论: 1 条 A+

“Right Now” 挂件动作

right_now_content_table_end

原文:Adds table rows at the bottom the content column of the Right Now Dashboard widget.

翻译:在右仪表盘小部件的内容栏底部添加表行。

right_now_table_end

原文:Called after displaying the number of Spam comments in the Discussion column of the Right Now Dashboard widget.

翻译:在现在的仪表盘小部件的讨论栏中显示垃圾邮件评论的数量后调用。

right_now_discussion_table_end

原文:Called after displaying the number of Spam comments and after the right_now_table_end in the Discussion column of the Right Now Dashboard widget.

翻译:在显示现在的仪表盘小部件的讨论栏中显示垃圾邮件评论的数量,和right_now_table_end结束操作之后调用。

right_now_end

原文:Called after the current version information is displayed on the Right Now Dashboardwidget. (Note: In v3.4, this is actually rightnow_end. See ticket #21046.)

翻译:在当前版本的信息显示在现在的Dashboardwidget

activity_box_end

原文:Last action called on the Right Now Dashboard widget.

翻译:调用当前仪表盘小部件的最后一个动作。

Actions

本节包含与WordPress使用的查询有关的动作,以确定要显示哪些帖子、WordPress循环、激活插件和其他基本级别WordPress代码(This section contains actions related to the queries WordPress uses to figure out what posts to display, the WordPress loop, activating plugins, and other fundamental-level WordPress code.)。

activated_plugin

原文:Runs any time any plugin is successfully activated

翻译:在任何时候任何插件被成功激活

add_meta_boxes

原文:Runs when “edit post” page loads. (3.0+)

解释:写文章页面载入时

 

admin_menu

原文:Runs after the basic admin panel menu structure is in place.

解释:后台左侧管理菜单结构

network_admin_notices

原文:Runs after the admin menu is printed to network admin screens.

解释:显示到网格管理界面。

user_admin_notices

原文:Runs after the admin menu is printed to user admin screens.

解释:用户管理界面

admin_notices

原文:Runs after the admin menu is printed to screens that aren’t network- or user-admin screens.

解释:不显示网络管理界面或用户管理界面的管理菜单之后

all_admin_notices

原文:Runs after the admin menu is printed to all screens.

解释:后台所有页面

blog_privacy_selector

原文:Runs after the default blog privacy options are printed on the screen.

解释:在默认博客隐私选项显示在界面后。

check_admin_referer

原文:Runs in the default check_admin_referer() function after the nonce has been checked for security purposes, to allow a plugin to force WordPress to die for extra security reasons. Note that check_admin_referrer is also a “pluggable” function, meaning that plugins can override it; see Plugin API).

解释:运行在同名函数check_admin_referer()中,安全被检查后。

check_ajax_referer

原文:Runs in the default check_ajax_referer() function (which is called when an AJAX request goes to the wp-admin/admin-ajax.php script) after the user’s login and password have been successfully validated from cookies, to allow a plugin to force WordPress to die for extra security reasons. Note that check_ajax_referer is also a “pluggable” function, meaning that plugins can override it; see Plugin API).

解释:运行在函数check_ajax_referer()

customize_register

原文:Runs on every request, allowing developers to register new theme options and controls for use with the Theme Customization API (as of Version 3.4).

解释:在每个请求都运行,允许开发者注册新的主题选项和控制菜单

deactivated_plugin

原文:Runs any time any plugin is successfully de-activated

解释:任何时候任何插件被取消激活时

generate_rewrite_rules

原文:Runs after the rewrite rules are generated. Action function arguments: WP_Rewrite object ($wp_rewrite) by reference. Note that it is easier to use the rewrite_rules_array filter instead of this action, to modify the rewrite rules.

解释:url规则被重写后

init

原文:Runs after WordPress has finished loading but before any headers are sent. Useful for intercepting $_GET or $_POST triggers.

解释:程序运行完成之后,发送http头信息之前

loop_end

原文:Runs after the last post of the WordPress loop is processed.

解释:最后post被处理后

loop_start

原文:Runs before the first post of the WordPress loop is processed.

解释:第一条post被处理之前

network_admin_menu

原文:Runs when the basic menu structure is prepared for the Network administration page. (Administration Menus)

解释:在网络管理页面的基础菜单结构被处理后

parse_query

原文:Runs at the end of query parsing in the main query or any instance of WP_Query, such as query_posts, get_posts, or get_children. Action function arguments: WP_Query object by reference.

解释:在一些解析http请求的函数之后

parse_request

原文:Runs after the query request is parsed inside the main WordPress function wp. Action function argument: WP object ($wp) by reference.

解释:在主函数wp解析http之后

pre_get_posts

原文:Runs before a query is executed in the main query or any instance of WP_Query, such as query_posts(), get_posts(), or get_children(). This hook is called after the query variable object is created, but before the query is actually run, and can be used to to alter the primary query before it is run. Also see is_main_query(). Action function arguments: WP_Query object by reference.

解释:在一些解析http函数之前,在请求变量对象被创建之后,但在请求使用之前可以改变

sanitize_comment_cookies

原文:Runs after cookies have been read from the HTTP request.

翻译:从http获取cookies之后

send_headers

原文:Runs after the basic HTTP headers are sent inside the main WordPress function wp(). Action function argument: WP object ($wp) by reference.

翻译:在wp()函数中发送http后

shutdown

原文:Runs when the page output is complete.

解释:页面显示完成

update_(meta_type)_meta

原文:Runs when a metadata gets saved.

解释:将要保持数据时

updated_(meta_type)_meta

原文:Runs when a metadata has been updated.

解释:数据保存后

upgrader_process_complete

原文:Runs when the plugin downloader/upgrader class finishes running

解释:当插件下载/更新完成时

wp_loaded

原文:This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.

解释:所以插件主题载入完成后

wp

原文:Executes after the query has been parsed and post(s) loaded, but before any template execution, inside the main WordPress function wp(). Useful if you need to have access to post data but can’t use templates for output. Action function argument: WP object ($wp) by reference.

解释:在WordPress函数wp()中,执行查询后已解析和加载后,但在任何模板执行前。使用在您需要访问数据后却不使用模板输出的情况下。

 

Principle Team
龙砚庭官方QQ群,一个坚持强怼的7P成员群!
10人已关注

目前评论:1   其中:访客  1   博主  0

发表评论

莫慌,小狮子正在努力加载评论...
  1. 西枫里博客
    西枫里博客3 ( 2018.05.11 0:10:20 )  沙发

    标记收藏~