I'm attempting to modify the WooCommerce REST API response with the
I've got this working as intended. The only thing left is that I need to make it so that the contents of this function only apply to requests made with one specific API key.
In other words, the REST API response should remain completely unchanged for every API user/key except for one specific one. Responses to requests using the specific key only should be modified by my function.
I've Googled around quite a bit and haven't found what I'm looking for. Is there an easy way to check the user / API key against an arbitrary value, so that if they don't match then the response goes unmodified?
Thank you in advance.