【发布时间】:2011-04-22 23:39:42
【问题描述】:
我在functions.php中有下面的方法。我正在尝试获取留下评论的帖子的标题,以及评论本身的名称、电子邮件和内容。
add_action('comment_post', 'comment_posted');
function comment_posted($comment_id) {
//what can I do here to get the original title of the post
//what can I do here to get the details of the comment (name, email, content)?
}
我尝试了 the_title() 和 get_the_title() 的变体,但没有成功。
【问题讨论】: