Hey @vforte – thank you very much for reaching out, as well as for using our plugin.
The trigger fires since Woocommerce is updating the customer as well within that call, which is technically correct to fire.
If you want to fully control where to fire it or not, you would require some custom code.
Down below, I created an example for you that allows you to only fire the trigger when a user visits his profile page within the backend. This should give you a better understanding on how you can make it.
Please note: Once you added the code, the trigger will only fire once you are on your profile.php page within your admin area.
add_filter( 'wpwhpro/admin/webhooks/is_valid_trigger_response', 'limit_user_update_webhook_trigger', 10, 4 );
function limit_user_update_webhook_trigger( $response, $webhook, $data, $args ){
//Make sure we only check on the update_user webhook trigger
if( is_array( $webhook ) && isset( $webhook['webhook_name'] ) && $webhook['webhook_name'] === 'update_user' ){
//Load the current page definition
global $pagenow;
//Set the webhook trigger by default to false - this causes the trigger to not fire at all
$response['is_valid'] = false;
//Check if the user is on the profile page and only then allow the trigger to fire
if( $pagenow == 'profile.php' ){
$response['is_valid'] = false;
}
}
return $response;
}
If you have any further questions, feel free to reach out again.