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

Actions

after_setup_theme

原文:Runs during a themes initialization. Is generally used to perform basic setup, registration, and init s for a theme.

翻译:在主题初始化期间。一般是用来进行基本的设置,登记,并为主题的初始化动作。

comment_form

原文:Runs in standard themes to insert the comment form. Action function argument: post ID.

翻译:在标准的主题中插入评论表单。参数:post ID

do_robots

原文:Runs when the template file chooser determines that it is a robots.txt request.

翻译:当模板文件是 robots.txt时

do_robotstxt

原文:Runs in the do_robots() function before it prints out the Disallow lists for the robots.txt file.

翻译:在do_robots()功能之前,打印出不允许的robots.txt文件列表。

get_footer

原文:Runs when the template calls the get_footer() function, just before the footer.php template file is loaded.

翻译:在模板中调用get_footer()方法时,仅在footer.php模板被载入前

get_header

原文:Runs when the template calls the get_header() function, just before the header.php template file is loaded.

翻译:在模板中调用get_header()方法时,仅在header.php模板被载入前

switch_theme

原文:Runs when the blog’s theme is changed. Action function argument: name of the new theme. If used in a theme, it only works if the theme that adds action is the one being disabled.

翻译:当主题改变时

after_switch_theme

原文:Runs when the blog’s theme is changed. Action function argument: name of the new theme. If used in a theme, it only works if the theme that adds action is the one being enabled. Can be used to run certain code when enabling a theme.

翻译:模板改变后

load-themes.php

原文:Runs when the theme is activate or deactivate (replace by an other).

翻译:当主题被激活或被替换时

template_redirect

原文:Runs before the determination of the template file to be used to display the requested page.

翻译:确定使用该模板文件来作为显示页面之前。

wp_footer

原文:Runs when the template calls the wp_footer() function, generally near the bottom of the blog page.

翻译:当调用函数wp_footer()时,通常在博客底部

wp_head

原文:Runs when the template calls the wp_head() function. This hook is generally placed near the top of a page template between <head> and </head>. This hook does not take any parameters.

翻译:当模板调用wp_head()时,通常在<head>与</head>之间

wp_meta

原文:Runs when the sidebar.php template file calls the wp_meta() function, to allow the plugin to insert content into the sidebar.

翻译:当模板sidebar.php文件调用wp_meta()方法时,用作插件在侧边栏插入内容

wp_print_scripts

原文:Runs just before WordPress prints registered JavaScript scripts into the page header.

翻译:脚本注册之前

 

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

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

发表评论

莫慌,小狮子正在努力加载评论...
  1. 西枫里博客
    西枫里博客3 ( 2018.05.07 2:29:25 )  沙发

    标记收藏。好像瞬间明白了WP的主题扩展是个完整的函数式编程~