diff --git src/wp-includes/class-wp-term-query.php src/wp-includes/class-wp-term-query.php
index 9da5a20f32..25f8ede047 100644
--- src/wp-includes/class-wp-term-query.php
+++ src/wp-includes/class-wp-term-query.php
@@ -677,7 +677,7 @@ class WP_Term_Query {
 		$cache_key    = "get_terms:$key:$last_changed";
 		$cache        = wp_cache_get( $cache_key, 'terms' );
 		if ( false !== $cache ) {
-			if ( 'all' === $_fields ) {
+			if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) {
 				$cache = $this->populate_terms( $cache );
 			}
 
diff --git tests/phpunit/tests/term/query.php tests/phpunit/tests/term/query.php
index 39496b16cb..660de46e1b 100644
--- tests/phpunit/tests/term/query.php
+++ tests/phpunit/tests/term/query.php
@@ -318,6 +318,36 @@ class Tests_Term_Query extends WP_UnitTestCase {
 		}
 	}
 
+	public function test_all_with_object_id_should_return_term_objects() {
+		register_taxonomy( 'wptests_tax_1', 'post' );
+		$posts = self::factory()->post->create_many( 2 );
+		$t     = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) );
+
+		foreach ( $posts as $p ) {
+			wp_set_object_terms( $p, array( $t ), 'wptests_tax_1' );
+		}
+
+		$query = new WP_Term_Query();
+		$args = array(
+			'taxonomy'   => 'wptests_tax_1',
+			'object_ids' => $posts,
+			'fields'     => 'all_with_object_id',
+		);
+
+		$terms = $query->query( $args );
+		$this->assertNotEmpty( $terms );
+		foreach ( $terms as $term ) {
+			$this->assertInstanceOf( 'WP_Term', $term );
+		}
+
+		// Run again to check the cached response.
+		$terms = $query->query( $args );
+		$this->assertNotEmpty( $terms );
+		foreach ( $terms as $term ) {
+			$this->assertInstanceOf( 'WP_Term', $term );
+		}
+	}
+
 	/**
 	 * @ticket 37198
 	 * @group cache
