WordPress的do_action和add_action的介绍
http://codex.WordPress.org/Function_Reference/do_action…
http://codex.WordPress.org/Function_Reference/do_action
http://codex.WordPress.org/Function_Reference/add_action
Understanding do_action() and add_action() – Revisited
代码:
do_action(‘mytheme_aboveblog’);
add_action(‘mytheme_aboveblog’, ‘mytheme_online_user_message’);
function mytheme_online_user_message() {
global $current_user;
if (!empty($current_user)) {
$user_login = addslashes($current_user->user_login);
echo “Hello {$user_login}!”;
}
}
类别:WordPress经验、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!