Comment Approval Doesn't Trigger Actions
Approving a comment via the mobile interface doesn't (completely) work. The comment becomes visible, but comment counters don't update, email notifications aren't triggered etc.
This is caused in /plugins/wpmp_switcher/pages/mobile_admin.php
It currently writes directly to the database using
$wpdb->query("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$id' LIMIT 1");
It should use official function http://codex.wordpress.org/Function_Reference/wp_set_comment_status
So, rather than directly manipulating the database, we can simply call
wp_set_comment_status( $id, 'approve' );
(I've corrected this for Approve & Spam - I've also added the Delete function.)
This is caused in /plugins/wpmp_switcher/pages/mobile_admin.php
It currently writes directly to the database using
$wpdb->query("UPDATE $wpdb->comments SET comment_approved='1' WHERE comment_ID='$id' LIMIT 1");
It should use official function http://codex.wordpress.org/Function_Reference/wp_set_comment_status
So, rather than directly manipulating the database, we can simply call
wp_set_comment_status( $id, 'approve' );
(I've corrected this for Approve & Spam - I've also added the Delete function.)
Leave a comment
Committed Rev 180181
on 2009-12-09 11:32 *
By James Pearce
Milestone changed from Backlog to v1.1.9 - Device group theming & beta of Nokia themes