Skip to content

Commit a573ed3

Browse files
authored
Merge pull request #13 from PolyPlugins/version/1.1.1
Bugfixes
2 parents 950b356 + 9e27a91 commit a573ed3

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ Yes, the plugin supports uploading images to the WordPress media library via the
6565

6666
## Changelog
6767

68+
### 1.1.1
69+
* Bugfix: When updating a products SKU it says it already exists when it doesn't
70+
6871
### 1.1.0
6972
* Added: Ability to schedule posts using publish_on for [Create Post](https://www.polyplugins.com/docs/content-api/api/create-post/)
7073
* Updated: [Create Post](https://www.polyplugins.com/docs/content-api/api/create-post/) to only require title, content, and categories, as yoast and tags aren't a requirement.

content-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Content API
55
* Plugin URI: https://www.polyplugins.com/contact/
66
* Description: Adds various endpoints to create content
7-
* Version: 1.1.0
7+
* Version: 1.1.1
88
* Requires at least: 6.5
99
* Requires PHP: 7.4
1010
* Author: Poly Plugins
@@ -607,7 +607,7 @@ public function update_product(WP_REST_Request $request) {
607607
if ($sku) {
608608
$product_id_by_sku = wc_get_product_id_by_sku($sku);
609609

610-
if ($product_id_by_sku != $product->get_id()) {
610+
if ($product_id_by_sku && (int) $product_id_by_sku !== (int) $product->get_id()) {
611611
return new WP_Error('product_sku_exists', 'Product with provided SKU already exists', array('status' => 404));
612612
}
613613
}

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: polyplugins
33
Tags: content api, rest api, content, creative, api
44
Tested up to: 6.8
5-
Stable tag: 1.1.0
5+
Stable tag: 1.1.1
66
Requires PHP: 7.4
77
License: GPLv3
88
License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -84,6 +84,9 @@ Yes, the plugin supports uploading images to the WordPress media library via the
8484

8585
== Changelog ==
8686

87+
= 1.1.1 =
88+
* Bugfix: When updating a products SKU it says it already exists when it doesn't
89+
8790
= 1.1.0 =
8891
* Added: Ability to schedule posts using publish_on for [Create Post](https://www.polyplugins.com/docs/content-api/api/create-post/)
8992
* Updated: [Create Post](https://www.polyplugins.com/docs/content-api/api/create-post/) to only require title, content, and categories

0 commit comments

Comments
 (0)