1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Comment Cache bug plugin |
---|
4 | Plugin URI: http://bobrik.name/ |
---|
5 | Description: Shows why it buggy |
---|
6 | Version: 0.1 |
---|
7 | Author: Ivan Babrou <ibobrik@gmail.com> |
---|
8 | Author URI: http://bobrik.name/ |
---|
9 | */ |
---|
10 | |
---|
11 | function hoho($id) |
---|
12 | { |
---|
13 | global $wpdb; |
---|
14 | $comment = get_comment($id); |
---|
15 | error_log("WRONG: ".$wpdb->get_var("SELECT comment_approved FROM wp.wp_comments WHERE comment_id = ".$id)." real, but ".$comment->comment_approved." returned by comment object"); |
---|
16 | return $wpdb->get_var("SELECT comment_approved FROM wp.wp_comments WHERE comment_id = ".$id); |
---|
17 | } |
---|
18 | |
---|
19 | add_action('wp_set_comment_status', 'hoho'); |
---|
20 | |
---|
21 | ?> |
---|