Skip to content

Commit 25d9608

Browse files
authored
Merge pull request #8 from PolyPlugins/version/1.0.8
Updated: Product endpoint
2 parents 0562208 + f50b226 commit 25d9608

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

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.0.8
69+
* Updated: [Update Product](https://www.polyplugins.com/docs/content-api/api/update-product/) endpoint to handle updating sku when product id is provided.
70+
6871
### 1.0.7
6972
* Added: weight attribute to results of [Get Product](https://www.polyplugins.com/docs/content-api/api/get-product/) endpoint
7073
* Added: weight attribute to [Update Product](https://www.polyplugins.com/docs/content-api/api/update-product/) endpoint

content-api.php

Lines changed: 1 addition & 5 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.0.7
7+
* Version: 1.0.8
88
* Requires at least: 6.5
99
* Requires PHP: 7.4
1010
* Author: Poly Plugins
@@ -520,10 +520,6 @@ public function update_product(WP_REST_Request $request) {
520520
}
521521
}
522522

523-
if ($product_id && $sku) {
524-
return new WP_Error('conflicting_identifiers', 'Both Product ID and SKU are provided. Please provide only one.', array('status' => 400));
525-
}
526-
527523
if ($sku && !$product_id) {
528524
$product_id_by_sku = wc_get_product_id_by_sku($sku);
529525

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.0.7
5+
Stable tag: 1.0.8
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.0.8 =
88+
* Updated: [Update Product](https://www.polyplugins.com/docs/content-api/api/update-product/) endpoint to handle updating sku when product id is provided.
89+
8790
= 1.0.7 =
8891
* Added: weight attribute to results of [Get Product](https://www.polyplugins.com/docs/content-api/api/get-product/) endpoint
8992
* Added: weight attribute to [Update Product](https://www.polyplugins.com/docs/content-api/api/update-product/) endpoint

0 commit comments

Comments
 (0)