-
Notifications
You must be signed in to change notification settings - Fork 221
[Store Customization] Update product slug when updating the title and flush cache #11952
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.61 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
), | ||
) | ||
); | ||
flush_rewrite_rules(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@albarin, my apologies, as this just occurred to me after the PR was merged: could we change here to ensure the rewrite rules are flushed only after all dummy products were created? Flushing the rewrite rules every time a new product is created is very expensive.
What
This PR updates the product slug when updating the dummy product titles and flushes the permalinks cache after it.
Why
Before doing this we ended up with a product with AI-generated titles but the permalinks corresponding to the dummy titles (like
my-awesome-product-3
). This fixes that issue and the 404 on products that occur on occasion.Fixes #11831
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Please test the feature on a WooExpress install instead of Jurassic Ninja, as the latter can be very limited in terms of server resources and unstable, as other installs can interfere with your own.
/wp-admin/tools.php?page=woocommerce-admin-test-helper
and enablecustomize-store
feature flag:Test the CYS experience
Screenshots or screencast
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog