Ticket #40669: 40669-comments.diff
| File 40669-comments.diff, 1.5 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/comment.php
423 423 * @return int|bool Meta ID on success, false on failure. 424 424 */ 425 425 function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) { 426 return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique); 426 $added = add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique ); 427 if ( $added ) { 428 wp_cache_set( 'last_changed', microtime(), 'comments' ); 429 } 430 431 return $added; 427 432 } 428 433 429 434 /** … … 442 447 * @return bool True on success, false on failure. 443 448 */ 444 449 function delete_comment_meta($comment_id, $meta_key, $meta_value = '') { 445 return delete_metadata('comment', $comment_id, $meta_key, $meta_value); 450 $deleted = delete_metadata( 'comment', $comment_id, $meta_key, $meta_value ); 451 if ( $deleted ) { 452 wp_cache_set( 'last_changed', microtime(), 'comments' ); 453 } 454 455 return $deleted; 446 456 } 447 457 448 458 /** … … 479 489 * @return int|bool Meta ID if the key didn't exist, true on successful update, false on failure. 480 490 */ 481 491 function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') { 482 return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value); 492 $updated = update_metadata( 'comment', $comment_id, $meta_key, $meta_value, $prev_value ); 493 if ( $updated ) { 494 wp_cache_set( 'last_changed', microtime(), 'comments' ); 495 } 496 497 return $updated; 483 498 } 484 499 485 500 /**