diff --git a/modules/ppcp-api-client/src/Endpoint/CatalogProducts.php b/modules/ppcp-api-client/src/Endpoint/CatalogProducts.php index 32296f4ee..8a04e693e 100644 --- a/modules/ppcp-api-client/src/Endpoint/CatalogProducts.php +++ b/modules/ppcp-api-client/src/Endpoint/CatalogProducts.php @@ -83,13 +83,10 @@ class CatalogProducts { */ public function create( string $name, string $description ): Product { $data = array( - 'name' => $name, + 'name' => $name, + 'description' => $description ?: $name, ); - if ( $description ) { - $data['description'] = $description; - } - $bearer = $this->bearer->bearer(); $url = trailingslashit( $this->host ) . 'v1/catalogs/products'; $args = array( diff --git a/modules/ppcp-subscription/src/SubscriptionsApiHandler.php b/modules/ppcp-subscription/src/SubscriptionsApiHandler.php index 569bbf5a5..bf25d03d3 100644 --- a/modules/ppcp-subscription/src/SubscriptionsApiHandler.php +++ b/modules/ppcp-subscription/src/SubscriptionsApiHandler.php @@ -178,7 +178,15 @@ class SubscriptionsApiHandler { $data[] = (object) array( 'op' => 'replace', 'path' => '/description', - 'value' => $product->get_description(), + 'value' => substr( + strip_shortcodes( + wp_strip_all_tags( + $product->get_description() + ) + ), + 0, + 127 + ) ?: '', ); }