I don’t know what you wanna do, but I can do something when admin posts a comment reply from the admin panel with a function like this.
/* Call the function when comment is posted */
add_action('comment_post', 'my_admin_reply');
function my_admin_reply($id) {
/* Only do it when posting from admin */
if (is_admin()) {
$mycomment = get_comment($id);
$mycommentid = $mycomment->comment_ID;
$mycommentparent = $mycomment->comment_parent;
$mycommentcontent = $mycomment->comment_content;
/* Only do it when the comment has a parent */
if (!empty($mycommentparent)) {
/* Doing something with the comment contents */
$mycommentarr = array();
$mycommentarr['comment_ID'] = $mycommentid;
$mycommentarr['comment_content'] = $mycommentcontent . " Doing something!";
wp_update_comment($mycommentarr);
}
}
}
(@cupe78)
12 years, 6 months ago
Hi,
I have this problem:
I have to develop a custom action (a javascript control and a http post call whith comment content) on comment reply in the admin panel.
But there is no action that I can add, and I can’t override the called function. I think the only way to resolve it is to hack the core. But I wouldn’t. Could you suggest me something? What would be the best way to do this?