diff --git src/wp-includes/class-wp-taxonomy.php src/wp-includes/class-wp-taxonomy.php
index 94353d8..1836f2a 100644
--- src/wp-includes/class-wp-taxonomy.php
+++ src/wp-includes/class-wp-taxonomy.php
@@ -152,6 +152,13 @@ final class WP_Taxonomy {
 	public $cap;
 
 	/**
+	 * Whether this taxonomy should remember the order in which terms are added to objects
+	 *
+	 * @var bool
+	 */
+	public $sort;
+
+	/**
 	 * Rewrites information for this taxonomy.
 	 *
 	 * @since 4.7.0
@@ -267,6 +274,7 @@ final class WP_Taxonomy {
 			'meta_box_cb'           => null,
 			'meta_box_sanitize_cb'  => null,
 			'capabilities'          => array(),
+			'sort'                  => false,
 			'rewrite'               => true,
 			'query_var'             => $this->name,
 			'update_count_callback' => '',
diff --git src/wp-includes/class-wp-term-query.php src/wp-includes/class-wp-term-query.php
index b7c3b42..75b5566 100644
--- src/wp-includes/class-wp-term-query.php
+++ src/wp-includes/class-wp-term-query.php
@@ -232,6 +232,20 @@ class WP_Term_Query {
 		$taxonomies = isset( $query['taxonomy'] ) ? (array) $query['taxonomy'] : null;
 
 		/**
+		 * If all the requested taxonomies are sortable by term_order
+		 * via the WP_Taxonomy::$sort flag we can set the default sort order
+		 * to term_order.
+		 */
+		if ( is_array( $taxonomies ) ) {
+			$ts = array_map( 'get_taxonomy', $taxonomies );
+			if ( count( array_filter( wp_list_pluck( $ts, 'sort' ) ) ) == count( $taxonomies ) ) {
+				if ( ( $t = get_taxonomy( $taxonomies[0] ) ) && $t->sort ) {
+					$this->query_var_defaults['orderby'] = 'term_order';
+				}
+			}
+		}
+
+		/**
 		 * Filters the terms query default arguments.
 		 *
 		 * Use {@see 'get_terms_args'} to filter the passed arguments.
diff --git src/wp-includes/taxonomy.php src/wp-includes/taxonomy.php
index df828b0..7301c8e 100644
--- src/wp-includes/taxonomy.php
+++ src/wp-includes/taxonomy.php
@@ -377,6 +377,8 @@ function is_taxonomy_hierarchical( $taxonomy ) {
  *         @type string $delete_terms Default 'manage_categories'.
  *         @type string $assign_terms Default 'edit_posts'.
  *     }
+ *     @type bool          $sort                  Whether this taxonomy should remember the order in which terms are
+ *                                                added to objects. Default false.
  *     @type bool|array    $rewrite {
  *         Triggers the handling of rewrites for this taxonomy. Default true, using $taxonomy as slug. To prevent
  *         rewrite, set to false. To specify rewrite rules, an array can be passed with any of these keys:
@@ -3312,8 +3314,20 @@ function update_object_term_cache( $object_ids, $object_type ) {
 
 	$object_ids = array_map( 'intval', $object_ids );
 
+	$sorted_taxonomies = array();
 	$taxonomies = get_object_taxonomies( $object_type );
 
+	/**
+	 * Split the sorted taxonomies out. They will
+	 * be ordered by term_order.
+	 */
+	foreach ( $taxonomies as $index => $taxonomy ) {
+		if ( ( $t = get_taxonomy( $taxonomy ) ) && $t->sort ) {
+			$sorted_taxonomies[] = $taxonomy;
+			unset( $taxonomies[ $index ] );
+		}
+	}
+
 	$ids = array();
 	foreach ( (array) $object_ids as $id ) {
 		foreach ( $taxonomies as $taxonomy ) {
@@ -3336,6 +3350,16 @@ function update_object_term_cache( $object_ids, $object_type ) {
 		)
 	);
 
+	$sorted_terms = wp_get_object_terms(
+		$ids, $sorted_taxonomies, array(
+			'fields'                 => 'all_with_object_id',
+			'orderby'                => 'term_order',
+			'update_term_meta_cache' => false,
+		)
+	);
+
+	$terms = array_merge( $terms, $sorted_terms );
+
 	$object_terms = array();
 	foreach ( (array) $terms as $term ) {
 		$object_terms[ $term->object_id ][ $term->taxonomy ][] = $term->term_id;
diff --git tests/phpunit/tests/term/query.php tests/phpunit/tests/term/query.php
index b517417..440ba8f 100644
--- tests/phpunit/tests/term/query.php
+++ tests/phpunit/tests/term/query.php
@@ -614,4 +614,33 @@ class Tests_Term_Query extends WP_UnitTestCase {
 		);
 		$this->assertSame( array(), $q->terms );
 	}
+
+	/**
+	 * @ticket 40436
+	 */
+	public function test_taxonomy_sort_flag_orderby_term_order() {
+		$post_id = self::factory()->post->create();
+		register_taxonomy( 'wptests_sort_tax', array( 'post' ), array( 'sort' => true, 'hierarchical' => false ) );
+
+		$t = get_taxonomy( 'wptests_sort_tax' );
+		$this->assertTrue( $t->sort );
+
+		$terms = array( 'three', 'and', 'four', 'five' );
+		wp_set_object_terms( $post_id, $terms, 'wptests_sort_tax' );
+
+		// Make sure global term cache provides the correct order
+		update_object_term_cache( $post_id, 'post' );
+
+		$q = new WP_Term_Query(
+			array(
+				'taxonomy'  => 'wptests_sort_tax',
+				'object_ids' => $post_id,
+			)
+		);
+		$this->assertSame( $terms, wp_list_pluck( $q->terms, 'slug' ) );
+
+		// Test metabox taxonomy (admin advanced edit)
+		$terms_to_edit = get_terms_to_edit( $post_id, 'wptests_sort_tax' );
+		$this->assertEquals( implode( ',', $terms ), $terms_to_edit );
+	}
 }
