Prevent action to trigger when product_tag is created via a rest api call
-
Hello,
I am creating/updating product_tag taxonomy from a remote REST API call from a third service.
I have set the following action in my functions.php that fires properly when na product_tag is created inside wordpress/woocommerce that update my third service with the new tag.
add_action( 'created_term', 'wpse_created_term', 10, 3 );
But when that product tag is created from the third party service with a remote api call, the action is triggered so it trigger the tag creation again in the third service !!!
I have like a loop that I cannot stop.
How can I detect that product tag is created via REST API and so how can I prevent executing the action when creation made by api only?
Thanks for your help,
Best
- The topic ‘Prevent action to trigger when product_tag is created via a rest api call’ is closed to new replies.