Added a comment clarifying the suffix substring when checking slug uniqueness
This commit is contained in:
parent
55f49ae26a
commit
661f2b7722
|
@ -259,6 +259,7 @@ class WC_Admin_Duplicate_Product {
|
||||||
// Find the maximum suffix so we can ensure uniqueness.
|
// Find the maximum suffix so we can ensure uniqueness.
|
||||||
$max_suffix = 1;
|
$max_suffix = 1;
|
||||||
foreach ( $results as $result ) {
|
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 ) );
|
$suffix = intval( substr( $result->post_name, strrpos( $result->post_name, '-' ) + 1 ) );
|
||||||
if ( $suffix > $max_suffix ) {
|
if ( $suffix > $max_suffix ) {
|
||||||
$max_suffix = $suffix;
|
$max_suffix = $suffix;
|
||||||
|
|
Loading…
Reference in New Issue