Is there anyway to detect if the current server operation is currently an AJAX request in WordPress?
For example:
is_ajax()
I personally prefer the wp_doing_ajax(), but here is another example that should do it.
wp_doing_ajax()
if( true === strpos( $_SERVER[ 'REQUEST_URI' ], 'wp-admin/admin-ajax.php' ) ) { // is doing ajax }