Merge pull request #13835 from woocommerce/fix-13829

Update product rating counts after adding a rating
This commit is contained in:
Mike Jolley 2017-03-30 11:16:40 +01:00 committed by GitHub
commit c83e725f99
1 changed files with 5 additions and 0 deletions

View File

@ -205,6 +205,11 @@ class WC_Comments {
return; return;
} }
add_comment_meta( $comment_id, 'rating', (int) esc_attr( $_POST['rating'] ), true ); add_comment_meta( $comment_id, 'rating', (int) esc_attr( $_POST['rating'] ), true );
$post_id = isset( $_POST['comment_post_ID'] ) ? (int) $_POST['comment_post_ID'] : 0;
if ( $post_id ) {
self::clear_transients( $post_id );
}
} }
} }