WP Review - Version 3.2.6

Version Description

  • Added optional 'id' parameter for shortcode
  • Added filter to modify style output
Download this release

Release Info

Developer MyThemeShop
Plugin Icon 128x128 WP Review
Version 3.2.6
Comparing to
See all releases

Code changes from version 3.2.5 to 3.2.6

Files changed (3) hide show
  1. includes/functions.php +93 -74
  2. readme.txt +5 -1
  3. wp-review.php +1 -1
includes/functions.php CHANGED
@@ -19,10 +19,10 @@ add_action('wp_ajax_mts_review_get_review', 'mts_review_get_review');
19
  add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
20
 
21
  /* Show with shortcode */
22
- add_shortcode('wp-review', 'wp_review_get_data');
23
  add_shortcode('wp-review-total', 'wp_review_total_shortcode');
24
  // aliases
25
- add_shortcode('wp_review', 'wp_review_get_data');
26
  add_shortcode('wp_review_total', 'wp_review_total_shortcode');
27
 
28
  // image sizes for the widgets
@@ -35,36 +35,39 @@ add_image_size( 'wp_review_small', 65, 65, true );
35
  * @since 1.0
36
  *
37
  */
38
- function wp_review_get_data() {
39
  global $post;
40
  global $blog_id;
41
  $options = get_option('wp_review_options');
42
 
 
 
 
43
  /* Retrieve the meta box data. */
44
- $heading = get_post_meta( $post->ID, 'wp_review_heading', true );
45
- $desc_title = get_post_meta( $post->ID, 'wp_review_desc_title', true );
46
  if ( ! $desc_title ) $desc_title = __('Summary', 'wp-review');
47
- $desc = get_post_meta( $post->ID, 'wp_review_desc', true );
48
- $items = get_post_meta( $post->ID, 'wp_review_item', true );
49
- $type = get_post_meta( $post->ID, 'wp_review_type', true );
50
- $total = get_post_meta( $post->ID, 'wp_review_total', true );
51
- $hide_desc = get_post_meta( $post->ID, 'wp_review_hide_desc', true );
52
- $allowUsers = get_post_meta( $post->ID, 'wp_review_userReview', true );
53
 
54
  $colors = array();
55
- $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
56
- $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
57
- $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
58
- $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
59
- $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
60
- $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
61
- $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
62
- $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
63
 
64
  if (!$colors['custom_colors'] && !empty($options['colors']) && is_array($options['colors'])) {
65
  $colors = array_merge($colors, $options['colors']);
66
  }
67
- $colors = apply_filters('wp_review_colors', $colors, $post->ID);
68
  $color = $colors['color'];
69
 
70
  /* Define a custom class for bar type. */
@@ -88,9 +91,9 @@ function wp_review_get_data() {
88
  * make sure the hook only apply on allowed post types
89
  */
90
  if ( $type != '' && is_singular($allowed_post_types) && is_main_query() ) {
91
- //if ( $type != '' && is_main_query() && in_array(get_post_type($post->ID), $allowed_post_types)) {
92
  // using this second if() instead of the first will allow reviews to be displayed on archive pages, but it may mess up excerpts
93
- $review = '<div id="review" class="review-wrapper wp-review-'.$post->ID.' ' . $class . ' delay-animation" >';
94
 
95
  /* Review title. */
96
  if( $heading != '' ){
@@ -222,10 +225,10 @@ function wp_review_get_data() {
222
  * USERS REVIEW AREA
223
  */
224
 
225
- if( is_array( $allowUsers ) && $allowUsers[0] == 1 ){
226
  $allowedClass = 'allowed-to-rate';
227
  $hasNotRatedClass = 'has-not-rated-yet';
228
- $postReviews = mts_get_post_reviews( $post->ID );
229
  $userTotal = $postReviews[0]->reviewsAvg;
230
  $usersReviewsCount = $postReviews[0]->reviewsNum;
231
 
@@ -245,7 +248,7 @@ function wp_review_get_data() {
245
  if ( is_user_logged_in() ) { $user_id = get_current_user_id(); }
246
  //echo $blog_id;
247
  $review .= '<input type="hidden" id="blog_id" value="'.$blog_id.'">';
248
- $review .= '<input type="hidden" id="post_id" value="'.$post->ID.'">';
249
  $review .= '<input type="hidden" id="user_id" value="'.$user_id.'">';
250
  $review .= '<input type="hidden" id="token" value="'.wp_create_nonce( "wp-review-security" ).'">';
251
 
@@ -254,7 +257,7 @@ function wp_review_get_data() {
254
  $review .= '<div class="user-total-wrapper"><span class="user-review-title">'.__('User Rating','wp-review').': </span><span class="review-total-box"><span id="mts-user-reviews-total">' . $userTotal . '</span> ';
255
  $review.= '<small>(<span id="mts-user-reviews-counter" >'.$usersReviewsCount.'</span> '.__('votes', 'wp-review').')</small></span></div>';
256
 
257
- if( hasPreviousReview( $post->ID, $user_id, $ip )) {
258
  $hasNotRatedClass = '';
259
  }
260
 
@@ -292,9 +295,9 @@ function wp_review_get_data() {
292
 
293
  $review .= '</div><!-- #review -->';
294
 
295
- $review = apply_filters('wp_review_get_data', $review, $post->ID, $type, $total, $items);
296
 
297
- return $review . wp_review_color_output(); // add color CSS to output
298
  } else {
299
  return '';
300
  }
@@ -340,36 +343,38 @@ function wp_review_inject_data( $content ) {
340
  * @since 1.0
341
  *
342
  */
343
- function wp_review_show_total($echo = true, $class = 'review-total-only') {
344
  global $post;
 
 
345
 
346
- $type = get_post_meta( $post->ID, 'wp_review_type', true );
347
- $total = get_post_meta( $post->ID, 'wp_review_total', true );
348
  $review = '';
349
 
350
  $options = get_option('wp_review_options');
351
  $colors = array();
352
- $colors['custom_location'] = get_post_meta( $post->ID, 'wp_review_custom_location', true );
353
- $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
354
- $colors['custom_width'] = get_post_meta( $post->ID, 'wp_review_custom_width', true );
355
-
356
- $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
357
- $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
358
- $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
359
- $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
360
- $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
361
- $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
362
- $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
363
 
364
  if (!$colors['custom_colors'] && !empty($options['colors']) && is_array($options['colors'])) {
365
  $colors = array_merge($colors, $options['colors']);
366
  }
367
- $colors = apply_filters('wp_review_colors', $colors, $post->ID);
368
 
369
  if (!empty($type) && (!empty($total) || $total === '0')) {
370
  wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), WP_REVIEW_PLUGIN_VERSION, 'all' );
371
 
372
- $review = '<div class="review-type-'.$type.' '.esc_attr($class).' wp-review-show-total wp-review-total-'.$post->ID.'"> ';
373
 
374
  if ( 'percentage' == $type ) {
375
  $review .= '<span class="review-total-box"><span>' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
@@ -398,7 +403,7 @@ function wp_review_show_total($echo = true, $class = 'review-total-only') {
398
  $review .= '</div>';
399
  }
400
 
401
- $review = apply_filters('wp_review_show_total', $review, $post->ID, $type, $total);
402
 
403
  if ($echo)
404
  echo $review;
@@ -409,7 +414,16 @@ function wp_review_total_shortcode($atts, $content) {
409
  if (empty($atts['class']))
410
  $atts['class'] = 'review-total-only review-total-shortcode';
411
 
412
- return wp_review_show_total(false, $atts['class']);
 
 
 
 
 
 
 
 
 
413
  }
414
 
415
  function mts_get_post_reviews( $post_id ){
@@ -429,30 +443,33 @@ function mts_get_post_reviews( $post_id ){
429
  *
430
  * @since 1.0
431
  */
432
- function wp_review_color_output() {
433
  global $post;
 
 
 
434
  $style = '';
435
  $options = get_option('wp_review_options');
436
  if (empty($options['colors'])) $options['colors'] = array();
437
  /* Retrieve the meta box data. */
438
  if(is_singular()) {
439
  $colors = array();
440
- $colors['custom_location'] = get_post_meta( $post->ID, 'wp_review_custom_location', true );
441
- $colors['custom_colors'] = get_post_meta( $post->ID, 'wp_review_custom_colors', true );
442
- $colors['custom_width'] = get_post_meta( $post->ID, 'wp_review_custom_width', true );
443
-
444
- $colors['color'] = get_post_meta( $post->ID, 'wp_review_color', true );
445
- $colors['type'] = get_post_meta( $post->ID, 'wp_review_type', true );
446
- $colors['fontcolor'] = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
447
- $colors['bgcolor1'] = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
448
- $colors['bgcolor2'] = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
449
- $colors['bordercolor'] = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
450
- $colors['total'] = get_post_meta( $post->ID, 'wp_review_total', true );
451
 
452
  if (!$colors['custom_colors']) {
453
  $colors = array_merge($colors, $options['colors']);
454
  }
455
- $colors = apply_filters('wp_review_colors', $colors, $post->ID);
456
 
457
  extract($colors, EXTR_SKIP);
458
 
@@ -462,37 +479,39 @@ function wp_review_color_output() {
462
 
463
  if ( 'star' == $type ) {
464
 
465
- $style .= '.wp-review-'.$post->ID.' .review-result-wrapper .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
466
- .wp-review-'.$post->ID.' .review-result-wrapper i{ color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }';
467
 
468
  } elseif ( 'point' == $type ) {
469
 
470
- $style .= '.wp-review-'.$post->ID.'.bar-point .review-result { background-color: '.$color.'; }';
471
 
472
  } elseif ( 'percentage' == $type ) {
473
 
474
- $style .= '.wp-review-'.$post->ID.'.percentage-point .review-result { background-color: '.$color.'; }';
475
 
476
  }
477
 
478
- $style .= '.wp-review-'.$post->ID.'.review-wrapper, .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-desc p{ color: '.$fontcolor.';}
479
- .wp-review-'.$post->ID.' .review-list li, .wp-review-'.$post->ID.'.review-wrapper{ background: '.$bgcolor2.';}
480
- .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-list li:nth-child(2n){background: '.$bgcolor1.';}
481
 
482
- .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result{background: none;}
483
- .wp-review-'.$post->ID.' .review-total-star.allowed-to-rate a i, .wp-review-comment-field a i, .wp-review-comment-rating a i { color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }
484
- .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result{text-indent:0;}
485
- .wp-review-'.$post->ID.'.bar-point .allowed-to-rate .review-result i, .wp-review-'.$post->ID.'.percentage-point .allowed-to-rate .review-result i, .wp-review-'.$post->ID.' .mts-user-review-star-container .selected i, .wp-review-'.$post->ID.' .user-review-area .review-result i, .wp-review-comment-field .review-result i, .wp-review-comment-rating .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
486
- .wp-review-'.$post->ID.'.review-wrapper, .wp-review-'.$post->ID.' .review-title, .wp-review-'.$post->ID.' .review-list li, .wp-review-'.$post->ID.' .review-list li:last-child, .wp-review-'.$post->ID.' .user-review-area{border-color: '.$bordercolor.';}';
487
 
488
  if( $total == '' ){
489
 
490
- $style .= '.wp-review-'.$post->ID.' .user-review-area{border: 1px solid '.$bordercolor.'; margin-top: 0px;}
491
- .wp-review-'.$post->ID.' .review-desc{width: 100%;}
492
- .wp-review-'.$post->ID.'.review-wrapper{border: none; overflow: visible;}';
493
  }
494
  $style .= '</style>';
495
 
 
 
496
  return $style;
497
  }
498
  }
19
  add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review');
20
 
21
  /* Show with shortcode */
22
+ add_shortcode('wp-review', 'wp_review_shortcode');
23
  add_shortcode('wp-review-total', 'wp_review_total_shortcode');
24
  // aliases
25
+ add_shortcode('wp_review', 'wp_review_shortcode');
26
  add_shortcode('wp_review_total', 'wp_review_total_shortcode');
27
 
28
  // image sizes for the widgets
35
  * @since 1.0
36
  *
37
  */
38
+ function wp_review_get_data( $post_id = null ) {
39
  global $post;
40
  global $blog_id;
41
  $options = get_option('wp_review_options');
42
 
43
+ if (empty($post_id))
44
+ $post_id = $post->ID;
45
+
46
  /* Retrieve the meta box data. */
47
+ $heading = get_post_meta( $post_id, 'wp_review_heading', true );
48
+ $desc_title = get_post_meta( $post_id, 'wp_review_desc_title', true );
49
  if ( ! $desc_title ) $desc_title = __('Summary', 'wp-review');
50
+ $desc = get_post_meta( $post_id, 'wp_review_desc', true );
51
+ $items = get_post_meta( $post_id, 'wp_review_item', true );
52
+ $type = get_post_meta( $post_id, 'wp_review_type', true );
53
+ $total = get_post_meta( $post_id, 'wp_review_total', true );
54
+ $hide_desc = get_post_meta( $post_id, 'wp_review_hide_desc', true );
55
+ $allowUsers = get_post_meta( $post_id, 'wp_review_userReview', true );
56
 
57
  $colors = array();
58
+ $colors['custom_colors'] = get_post_meta( $post_id, 'wp_review_custom_colors', true );
59
+ $colors['color'] = get_post_meta( $post_id, 'wp_review_color', true );
60
+ $colors['type'] = get_post_meta( $post_id, 'wp_review_type', true );
61
+ $colors['fontcolor'] = get_post_meta( $post_id, 'wp_review_fontcolor', true );
62
+ $colors['bgcolor1'] = get_post_meta( $post_id, 'wp_review_bgcolor1', true );
63
+ $colors['bgcolor2'] = get_post_meta( $post_id, 'wp_review_bgcolor2', true );
64
+ $colors['bordercolor'] = get_post_meta( $post_id, 'wp_review_bordercolor', true );
65
+ $colors['total'] = get_post_meta( $post_id, 'wp_review_total', true );
66
 
67
  if (!$colors['custom_colors'] && !empty($options['colors']) && is_array($options['colors'])) {
68
  $colors = array_merge($colors, $options['colors']);
69
  }
70
+ $colors = apply_filters('wp_review_colors', $colors, $post_id);
71
  $color = $colors['color'];
72
 
73
  /* Define a custom class for bar type. */
91
  * make sure the hook only apply on allowed post types
92
  */
93
  if ( $type != '' && is_singular($allowed_post_types) && is_main_query() ) {
94
+ //if ( $type != '' && is_main_query() && in_array(get_post_type($post_id), $allowed_post_types)) {
95
  // using this second if() instead of the first will allow reviews to be displayed on archive pages, but it may mess up excerpts
96
+ $review = '<div id="review" class="review-wrapper wp-review-'.$post_id.' ' . $class . ' delay-animation" >';
97
 
98
  /* Review title. */
99
  if( $heading != '' ){
225
  * USERS REVIEW AREA
226
  */
227
 
228
+ if( is_array( $allowUsers ) && $allowUsers[0] == 1 && $post_id == $post->ID ){
229
  $allowedClass = 'allowed-to-rate';
230
  $hasNotRatedClass = 'has-not-rated-yet';
231
+ $postReviews = mts_get_post_reviews( $post_id );
232
  $userTotal = $postReviews[0]->reviewsAvg;
233
  $usersReviewsCount = $postReviews[0]->reviewsNum;
234
 
248
  if ( is_user_logged_in() ) { $user_id = get_current_user_id(); }
249
  //echo $blog_id;
250
  $review .= '<input type="hidden" id="blog_id" value="'.$blog_id.'">';
251
+ $review .= '<input type="hidden" id="post_id" value="'.$post_id.'">';
252
  $review .= '<input type="hidden" id="user_id" value="'.$user_id.'">';
253
  $review .= '<input type="hidden" id="token" value="'.wp_create_nonce( "wp-review-security" ).'">';
254
 
257
  $review .= '<div class="user-total-wrapper"><span class="user-review-title">'.__('User Rating','wp-review').': </span><span class="review-total-box"><span id="mts-user-reviews-total">' . $userTotal . '</span> ';
258
  $review.= '<small>(<span id="mts-user-reviews-counter" >'.$usersReviewsCount.'</span> '.__('votes', 'wp-review').')</small></span></div>';
259
 
260
+ if( hasPreviousReview( $post_id, $user_id, $ip )) {
261
  $hasNotRatedClass = '';
262
  }
263
 
295
 
296
  $review .= '</div><!-- #review -->';
297
 
298
+ $review = apply_filters('wp_review_get_data', $review, $post_id, $type, $total, $items);
299
 
300
+ return $review . wp_review_color_output($post_id); // add color CSS to output
301
  } else {
302
  return '';
303
  }
343
  * @since 1.0
344
  *
345
  */
346
+ function wp_review_show_total($echo = true, $class = 'review-total-only', $post_id = null) {
347
  global $post;
348
+ if (empty($post_id))
349
+ $post_id = $post->ID;
350
 
351
+ $type = get_post_meta( $post_id, 'wp_review_type', true );
352
+ $total = get_post_meta( $post_id, 'wp_review_total', true );
353
  $review = '';
354
 
355
  $options = get_option('wp_review_options');
356
  $colors = array();
357
+ $colors['custom_location'] = get_post_meta( $post_id, 'wp_review_custom_location', true );
358
+ $colors['custom_colors'] = get_post_meta( $post_id, 'wp_review_custom_colors', true );
359
+ $colors['custom_width'] = get_post_meta( $post_id, 'wp_review_custom_width', true );
360
+
361
+ $colors['color'] = get_post_meta( $post_id, 'wp_review_color', true );
362
+ $colors['type'] = get_post_meta( $post_id, 'wp_review_type', true );
363
+ $colors['fontcolor'] = get_post_meta( $post_id, 'wp_review_fontcolor', true );
364
+ $colors['bgcolor1'] = get_post_meta( $post_id, 'wp_review_bgcolor1', true );
365
+ $colors['bgcolor2'] = get_post_meta( $post_id, 'wp_review_bgcolor2', true );
366
+ $colors['bordercolor'] = get_post_meta( $post_id, 'wp_review_bordercolor', true );
367
+ $colors['total'] = get_post_meta( $post_id, 'wp_review_total', true );
368
 
369
  if (!$colors['custom_colors'] && !empty($options['colors']) && is_array($options['colors'])) {
370
  $colors = array_merge($colors, $options['colors']);
371
  }
372
+ $colors = apply_filters('wp_review_colors', $colors, $post_id);
373
 
374
  if (!empty($type) && (!empty($total) || $total === '0')) {
375
  wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), WP_REVIEW_PLUGIN_VERSION, 'all' );
376
 
377
+ $review = '<div class="review-type-'.$type.' '.esc_attr($class).' wp-review-show-total wp-review-total-'.$post_id.'"> ';
378
 
379
  if ( 'percentage' == $type ) {
380
  $review .= '<span class="review-total-box"><span>' . $total . '</span> <i class="percentage-icon">%</i>' . '</span>';
403
  $review .= '</div>';
404
  }
405
 
406
+ $review = apply_filters('wp_review_show_total', $review, $post_id, $type, $total);
407
 
408
  if ($echo)
409
  echo $review;
414
  if (empty($atts['class']))
415
  $atts['class'] = 'review-total-only review-total-shortcode';
416
 
417
+ if (empty($atts['id']))
418
+ $atts['id'] = null;
419
+
420
+ return wp_review_show_total(false, $atts['class'], $atts['id']);
421
+ }
422
+ function wp_review_shortcode( $atts, $content = "") {
423
+ if (empty($atts['id']))
424
+ $atts['id'] = null;
425
+
426
+ return wp_review_get_data($atts['id']);
427
  }
428
 
429
  function mts_get_post_reviews( $post_id ){
443
  *
444
  * @since 1.0
445
  */
446
+ function wp_review_color_output($post_id) {
447
  global $post;
448
+ if (empty($post_id))
449
+ $post_id = $post->ID;
450
+
451
  $style = '';
452
  $options = get_option('wp_review_options');
453
  if (empty($options['colors'])) $options['colors'] = array();
454
  /* Retrieve the meta box data. */
455
  if(is_singular()) {
456
  $colors = array();
457
+ $colors['custom_location'] = get_post_meta( $post_id, 'wp_review_custom_location', true );
458
+ $colors['custom_colors'] = get_post_meta( $post_id, 'wp_review_custom_colors', true );
459
+ $colors['custom_width'] = get_post_meta( $post_id, 'wp_review_custom_width', true );
460
+
461
+ $colors['color'] = get_post_meta( $post_id, 'wp_review_color', true );
462
+ $colors['type'] = get_post_meta( $post_id, 'wp_review_type', true );
463
+ $colors['fontcolor'] = get_post_meta( $post_id, 'wp_review_fontcolor', true );
464
+ $colors['bgcolor1'] = get_post_meta( $post_id, 'wp_review_bgcolor1', true );
465
+ $colors['bgcolor2'] = get_post_meta( $post_id, 'wp_review_bgcolor2', true );
466
+ $colors['bordercolor'] = get_post_meta( $post_id, 'wp_review_bordercolor', true );
467
+ $colors['total'] = get_post_meta( $post_id, 'wp_review_total', true );
468
 
469
  if (!$colors['custom_colors']) {
470
  $colors = array_merge($colors, $options['colors']);
471
  }
472
+ $colors = apply_filters('wp_review_colors', $colors, $post_id);
473
 
474
  extract($colors, EXTR_SKIP);
475
 
479
 
480
  if ( 'star' == $type ) {
481
 
482
+ $style .= '.wp-review-'.$post_id.' .review-result-wrapper .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
483
+ .wp-review-'.$post_id.' .review-result-wrapper i{ color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }';
484
 
485
  } elseif ( 'point' == $type ) {
486
 
487
+ $style .= '.wp-review-'.$post_id.'.bar-point .review-result { background-color: '.$color.'; }';
488
 
489
  } elseif ( 'percentage' == $type ) {
490
 
491
+ $style .= '.wp-review-'.$post_id.'.percentage-point .review-result { background-color: '.$color.'; }';
492
 
493
  }
494
 
495
+ $style .= '.wp-review-'.$post_id.'.review-wrapper, .wp-review-'.$post_id.' .review-title, .wp-review-'.$post_id.' .review-desc p{ color: '.$fontcolor.';}
496
+ .wp-review-'.$post_id.' .review-list li, .wp-review-'.$post_id.'.review-wrapper{ background: '.$bgcolor2.';}
497
+ .wp-review-'.$post_id.' .review-title, .wp-review-'.$post_id.' .review-list li:nth-child(2n){background: '.$bgcolor1.';}
498
 
499
+ .wp-review-'.$post_id.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post_id.'.percentage-point .allowed-to-rate .review-result{background: none;}
500
+ .wp-review-'.$post_id.' .review-total-star.allowed-to-rate a i, .wp-review-comment-field a i, .wp-review-comment-rating a i { color: '.$color.'; opacity: 0.50; filter: alpha(opacity=50); }
501
+ .wp-review-'.$post_id.'.bar-point .allowed-to-rate .review-result, .wp-review-'.$post_id.'.percentage-point .allowed-to-rate .review-result{text-indent:0;}
502
+ .wp-review-'.$post_id.'.bar-point .allowed-to-rate .review-result i, .wp-review-'.$post_id.'.percentage-point .allowed-to-rate .review-result i, .wp-review-'.$post_id.' .mts-user-review-star-container .selected i, .wp-review-'.$post_id.' .user-review-area .review-result i, .wp-review-comment-field .review-result i, .wp-review-comment-rating .review-result i { color: '.$color.'; opacity: 1; filter: alpha(opacity=100); }
503
+ .wp-review-'.$post_id.'.review-wrapper, .wp-review-'.$post_id.' .review-title, .wp-review-'.$post_id.' .review-list li, .wp-review-'.$post_id.' .review-list li:last-child, .wp-review-'.$post_id.' .user-review-area{border-color: '.$bordercolor.';}';
504
 
505
  if( $total == '' ){
506
 
507
+ $style .= '.wp-review-'.$post_id.' .user-review-area{border: 1px solid '.$bordercolor.'; margin-top: 0px;}
508
+ .wp-review-'.$post_id.' .review-desc{width: 100%;}
509
+ .wp-review-'.$post_id.'.review-wrapper{border: none; overflow: visible;}';
510
  }
511
  $style .= '</style>';
512
 
513
+ $style = apply_filters('wp_review_color_output', $style, $post_id, $colors);
514
+
515
  return $style;
516
  }
517
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Creator's website link: http://mythemeshop.com/plugins/wp-review/
4
  Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
  Requires at least: 3.0.1
6
  Tested up to: 4.0
7
- Stable tag: 3.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -89,6 +89,10 @@ Please disable all plugins and check if rating is working properly. Then you can
89
 
90
  == Changelog ==
91
 
 
 
 
 
92
  = 3.2.5 =
93
  * Added loading animation in widget
94
  * Fixed minor bug in user ratings
4
  Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
  Requires at least: 3.0.1
6
  Tested up to: 4.0
7
+ Stable tag: 3.2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
89
 
90
  == Changelog ==
91
 
92
+ = 3.2.6 =
93
+ * Added optional 'id' parameter for shortcode
94
+ * Added filter to modify style output
95
+
96
  = 3.2.5 =
97
  * Added loading animation in widget
98
  * Fixed minor bug in user ratings
wp-review.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
  * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
- * Version: 3.2.5
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *
3
  * Plugin Name: WP Review
4
  * Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
  * Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
+ * Version: 3.2.6
7
  * Author: MyThemesShop
8
  * Author URI: http://mythemeshop.com/
9
  *