Detect if REST API is running

Question

Many times I have code and I want to make sure it only runs in a rest api context, or it never runs in a rest context.

I know there are some hooks, but is there a function similar to wp_is_doing_cron?

0
Tom J Nowell 4 months 0 Answers 23 views 0

Leave an answer