diff --git src/wp-includes/query.php src/wp-includes/query.php
index 2a77cc4..a9009ea 100644
--- src/wp-includes/query.php
+++ src/wp-includes/query.php
@@ -1230,6 +1230,15 @@ class WP_Query {
 	public $is_embed = false;
 
 	/**
+	 * True if query is within the context of a REST request.
+	 *
+	 * @since 4.4.0
+	 * @access public
+	 * @var bool
+	 */
+	public $is_rest = false;
+
+	/**
 	 * Set if query is within comments popup window.
 	 *
 	 * @since 1.5.0
@@ -4702,6 +4711,17 @@ class WP_Query {
 	}
 
 	/**
+	 * Is the query within the context of a REST request?
+	 *
+	 * @since 4.4.0
+	 *
+	 * @return bool
+	 */
+	public function is_rest() {
+		return (bool) $this->is_rest;
+	}
+
+	/**
 	 * Is the query the main query?
 	 *
 	 * @since 3.3.0
