Skip to main content
added 183 characters in body
Source Link
Tom J Nowell
  • 60.6k
  • 7
  • 77
  • 147

Yes, wp_is_json_request() can be used to determine if the current request is a REST API request

Checks whether current request is a JSON request, or is expecting a JSON response.

Official docs: https://developer.wordpress.org/reference/functions/wp_is_json_request/

Yes, wp_is_json_request() can be used to determine if the current request is a REST API request

Yes, wp_is_json_request() can be used to determine if the current request is a REST API request

Checks whether current request is a JSON request, or is expecting a JSON response.

Official docs: https://developer.wordpress.org/reference/functions/wp_is_json_request/

Source Link
Tom J Nowell
  • 60.6k
  • 7
  • 77
  • 147

Yes, wp_is_json_request() can be used to determine if the current request is a REST API request