From 661f2b7722974c4d60f53839138e2cc66c1d30ea Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Wed, 20 Nov 2019 10:02:34 -0800 Subject: [PATCH] Added a comment clarifying the suffix substring when checking slug uniqueness --- includes/admin/class-wc-admin-duplicate-product.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/class-wc-admin-duplicate-product.php b/includes/admin/class-wc-admin-duplicate-product.php index 3b67f336891..e6886f3ba3e 100644 --- a/includes/admin/class-wc-admin-duplicate-product.php +++ b/includes/admin/class-wc-admin-duplicate-product.php @@ -259,6 +259,7 @@ class WC_Admin_Duplicate_Product { // Find the maximum suffix so we can ensure uniqueness. $max_suffix = 1; foreach ( $results as $result ) { + // Pull a numerical suffix off the slug after the last hyphen. $suffix = intval( substr( $result->post_name, strrpos( $result->post_name, '-' ) + 1 ) ); if ( $suffix > $max_suffix ) { $max_suffix = $suffix;