Version Description
(2022-03-29) =
- Fixed updating of reviews with custom checkbox and toggle fields.
Download this release
Release Info
Developer | geminilabs |
Plugin | Site Reviews |
Version | 5.22.2 |
Comparing to | |
See all releases |
Code changes from version 5.22.1 to 5.22.2
- plugin/Commands/ToggleStatus.php +1 -1
- plugin/Controllers/ReviewController.php +2 -0
- readme.txt +5 -1
- site-reviews.php +1 -1
plugin/Commands/ToggleStatus.php
CHANGED
@@ -31,7 +31,7 @@ class ToggleStatus implements Contract
|
|
31 |
$postId = wp_update_post([
|
32 |
'ID' => $this->id,
|
33 |
'post_status' => $this->status,
|
34 |
-
]);
|
35 |
if (is_wp_error($postId)) {
|
36 |
glsr_log()->error($postId->get_error_message());
|
37 |
return [];
|
31 |
$postId = wp_update_post([
|
32 |
'ID' => $this->id,
|
33 |
'post_status' => $this->status,
|
34 |
+
], true); // return a \WP_Error on failure!
|
35 |
if (is_wp_error($postId)) {
|
36 |
glsr_log()->error($postId->get_error_message());
|
37 |
return [];
|
plugin/Controllers/ReviewController.php
CHANGED
@@ -408,7 +408,9 @@ class ReviewController extends Controller
|
|
408 |
glsr()->action('review/updated/post_ids', $review, Cast::toArray($assignedPostIds)); // trigger a recount of assigned posts
|
409 |
glsr()->action('review/updated/user_ids', $review, Cast::toArray($assignedUserIds)); // trigger a recount of assigned users
|
410 |
glsr(ResponseMetabox::class)->save($review);
|
|
|
411 |
$submittedValues = Helper::filterInputArray(glsr()->id);
|
|
|
412 |
if (Arr::get($submittedValues, 'is_editing_review')) {
|
413 |
$submittedValues['rating'] = Arr::get($submittedValues, 'rating');
|
414 |
$submittedValues['terms'] = Arr::get($submittedValues, 'terms', 0);
|
408 |
glsr()->action('review/updated/post_ids', $review, Cast::toArray($assignedPostIds)); // trigger a recount of assigned posts
|
409 |
glsr()->action('review/updated/user_ids', $review, Cast::toArray($assignedUserIds)); // trigger a recount of assigned users
|
410 |
glsr(ResponseMetabox::class)->save($review);
|
411 |
+
$customDefaults = array_fill_keys(array_keys($review->custom()->toArray()), '');
|
412 |
$submittedValues = Helper::filterInputArray(glsr()->id);
|
413 |
+
$submittedValues = wp_parse_args($submittedValues, $customDefaults); // this ensures we save all empty custom values
|
414 |
if (Arr::get($submittedValues, 'is_editing_review')) {
|
415 |
$submittedValues['rating'] = Arr::get($submittedValues, 'rating');
|
416 |
$submittedValues['terms'] = Arr::get($submittedValues, 'terms', 0);
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: reviews, ratings, testimonials, woocommerce, product reviews, business rev
|
|
5 |
Tested up to: 5.9
|
6 |
Requires at least: 5.5
|
7 |
Requires PHP: 5.6.20
|
8 |
-
Stable tag: 5.22.
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -142,6 +142,10 @@ All documentation can be found in the "Help" page of the plugin. If your questio
|
|
142 |
|
143 |
## Changelog
|
144 |
|
|
|
|
|
|
|
|
|
145 |
= 5.22.1 (2022-03-26) =
|
146 |
|
147 |
- Fixed custom translated strings
|
5 |
Tested up to: 5.9
|
6 |
Requires at least: 5.5
|
7 |
Requires PHP: 5.6.20
|
8 |
+
Stable tag: 5.22.2
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
142 |
|
143 |
## Changelog
|
144 |
|
145 |
+
= 5.22.2 (2022-03-29) =
|
146 |
+
|
147 |
+
- Fixed updating of reviews with custom checkbox and toggle fields.
|
148 |
+
|
149 |
= 5.22.1 (2022-03-26) =
|
150 |
|
151 |
- Fixed custom translated strings
|
site-reviews.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Plugin Name: Site Reviews
|
8 |
* Plugin URI: https://wordpress.org/plugins/site-reviews
|
9 |
* Description: Receive and display reviews on your website
|
10 |
-
* Version: 5.22.
|
11 |
* Author: Paul Ryley
|
12 |
* Author URI: https://geminilabs.io
|
13 |
* License: GPL2
|
7 |
* Plugin Name: Site Reviews
|
8 |
* Plugin URI: https://wordpress.org/plugins/site-reviews
|
9 |
* Description: Receive and display reviews on your website
|
10 |
+
* Version: 5.22.2
|
11 |
* Author: Paul Ryley
|
12 |
* Author URI: https://geminilabs.io
|
13 |
* License: GPL2
|