Changeset 2097498
- Timestamp:
- 05/29/2019 07:58:51 PM (7 years ago)
- Location:
- multilingual-comments/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
includes/class-multilingual-comments.php (modified) (1 diff)
-
public/class-multilingual-comments-public.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multilingual-comments/trunk/README.txt
r1700641 r2097498 3 3 Tags: wpml, woocommerce, reviews, multilingual, comments, review, comment 4 4 Requires at least: 3.0.0 5 Tested up to: 4.85 Tested up to: 5.1.1 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 26 26 = 1.0 = 27 27 * Initial release 28 29 = 1.0.1 = 30 * Bugfix - Division by zero when there are 0 comments -
multilingual-comments/trunk/includes/class-multilingual-comments.php
r1700073 r2097498 23 23 * version of the plugin. 24 24 * 25 * @since 1.0. 025 * @since 1.0.1 26 26 * @package Multilingual_Comments 27 27 * @subpackage Multilingual_Comments/includes -
multilingual-comments/trunk/public/class-multilingual-comments-public.php
r1700073 r2097498 195 195 $rating = 0; 196 196 $comments = get_comments(); 197 198 if( count( $comments ) == 0 ){ 199 return $rating; 200 } 201 197 202 foreach( $comments as $comment ){ 198 203 199 204 $rating += get_comment_meta( $comment->comment_ID, 'rating', true ); 200 205 201 206 } 202 207 203 208 $average_rating = $rating / count($comments); 204 209 return $average_rating;
Note: See TracChangeset
for help on using the changeset viewer.