plugin development – Why does add_action execute only after the second product update attempt?

Question

I have this plugin:

add_action( 'woocommerce_update_product', 'update_on_product_save', 1000, 1 );

function update_on_product_save( $product_id ) {
    do somthing
}

I was expecting the hook to execute after I press the product update button. This works, but only after the second update is clicked. In the first update, nothing happens, then after backend reload I click it again and it’s executed.

Any ideas on what to look for so it will be executed on the first update?

0
yoni349 2 months 2022-06-06T08:56:29-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse