add_action()函数的作用是添加一个挂钩行为关联,当指定的wordpress钩子被加载时,将触发其回调函数的执行,其结构形式如下:
1 | |
参数$tag(string) (required) 钩子的名字
$function_to_add(callback) (required) 回调函数的名字
$priority(int) (optional) 优先级
$accepted_args(int) (optional) 接受的参数个数
实例:
1 2 3 4 5 6 7 8 | |
转载自:http://www.web589.com/posts/1500.html