0

When a person adds a product, I want to automatically/programmatically set the product category based on the values of other product attributes.

I'm trying to look for the right hook where I can assign my own $_POST['product_cat'] value. Does anyone know which hook I should use to modify the $_POST array of value before it is created or updated? I tried all of the following, and they all seem to fire too late in the load cycle:

add_filter('wp_insert_post_data',...)
wp_insert_post
saved_post

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.