If you want to make further manipulations to your data after an update of the product data, or you eg. If you want to write data into another field, you can use this hook. This is used directly after the update of the product data.
Hook after a product update
1 2 3 4 5 6 7 |
function atkp_product_updated_callback($product_id) { $saleprice = ATKPTools::get_post_setting( $product_id, ATKP_PRODUCT_POSTTYPE.'_salepricefloat'); ATKPTools::set_post_setting( $product_id, 'mein_eigenes_feld', $saleprice); } add_action('atkp_product_updated', 'atkp_product_updated_callback'); |
Parameter | Description |
product_id | The ID of the product which is currently updated |
Rückgabewert | No return value. |
Hook after a list update
1 2 3 4 5 6 7 |
function atkp_list_updated_callback($list_id) { $url = ATKPTools::get_post_setting( $list_id, ATKP_LIST_POSTTYPE.'_url'); ATKPTools::set_post_setting( $list_id, 'mein_eigenes_feld', $url); } add_action('atkp_list_updated', 'atkp_list_updated_callback'); |
Parameter | Description |
list_id | The ID of the list which is currently updated |
Rückgabewert | No return value. |
Tip: Use a plugin like My Custom Functions or a child theme to build your hooks!