【发布时间】:2013-05-07 22:06:22
【问题描述】:
每当有人发表评论时,我想在 php 中采取一些行动。我怎样才能为此设置一个钩子?我认为它会进入functions.php...
编辑 - 这是我更新的代码:
add_action('comment_post', 'comment_posted');
function comment_posted() {
$MyClass = new MyClass(); //I do this in other functions and don't have any blank screen problems
$test = "";
$MyClass->doSomething($test);
}
【问题讨论】: