Create product title, permalink and slug from several ACF Pro fields
-
I want to create new products in backend (or update), without using the default WP title field.
The title (and permalink + slug) should always be created based on values selected in two dropdown boxes and one text field in ACF Pro (all are mandatory fields). When saving the product (also about 20 other custom fields) it should be created/updated and published. The title should be a combination of: “value 1 + 2 + 3”.Changes afterwards in the products default WP title field should be ignored (maybe hide that), unless the three custom fields that create the title have been edited. Updates in any of the three custom fields should not only update the title when saving, but also update the permalink and slug.
I created a solution to this at least 5 years ago, but it was a slow and bad solution as I′m not a coder. I can′t find that code, but it took about 30 seconds to save a product so there were probably several errors in that code! I have searched for an updated code in several forums, but I have not succeeded.
I really appreciate any help with this!
————————-
WP (5.8.1), Avada (7.5), ACF Pro (5.10.2), PHP (7.4.25). Smarter code and better performance with PHP version 8.0.12?
- The topic ‘Create product title, permalink and slug from several ACF Pro fields’ is closed to new replies.