Index: src/wp-includes/post-template.php
===================================================================
--- src/wp-includes/post-template.php	(revision 38699)
+++ src/wp-includes/post-template.php	(working copy)
@@ -505,25 +505,39 @@
 	// hentry for hAtom compliance
 	$classes[] = 'hentry';

-	// All public taxonomies
-	$taxonomies = get_taxonomies( array( 'public' => true ) );
-	foreach ( (array) $taxonomies as $taxonomy ) {
-		if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
-			foreach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {
-				if ( empty( $term->slug ) ) {
-					continue;
-				}
+	/**
+	 * Filters the showing of taxonomy term classes.
+	 *
+	 * @since 4.7.0
+	 *
+	 * @param bool $status Default to show taxonomy term classes.
+	 * @param WP_Post $post Post Object.
+	 */
+	if ( apply_filters( 'get_post_class_taxonomy', true, $post ) ) {
+		// All public taxonomies with show_term_classes turned on.
+		$taxonomies = get_taxonomies( array(
+			'public' => true,
+			'show_term_classes' => true,
+		) );

-				$term_class = sanitize_html_class( $term->slug, $term->term_id );
-				if ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {
-					$term_class = $term->term_id;
-				}
+		foreach ( (array) $taxonomies as $taxonomy ) {
+			if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
+				foreach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {
+					if ( empty( $term->slug ) ) {
+						continue;
+					}

-				// 'post_tag' uses the 'tag' prefix for backward compatibility.
-				if ( 'post_tag' == $taxonomy ) {
-					$classes[] = 'tag-' . $term_class;
-				} else {
-					$classes[] = sanitize_html_class( $taxonomy . '-' . $term_class, $taxonomy . '-' . $term->term_id );
+					$term_class = sanitize_html_class( $term->slug, $term->term_id );
+					if ( is_numeric( $term_class ) || ! trim( $term_class, '-' ) ) {
+						$term_class = $term->term_id;
+					}
+
+					// 'post_tag' uses the 'tag' prefix for backward compatibility.
+					if ( 'post_tag' == $taxonomy ) {
+						$classes[] = 'tag-' . $term_class;
+					} else {
+						$classes[] = sanitize_html_class( $taxonomy . '-' . $term_class, $taxonomy . '-' . $term->term_id );
+					}
 				}
 			}
 		}
Index: src/wp-includes/taxonomy.php
===================================================================
--- src/wp-includes/taxonomy.php	(revision 38699)
+++ src/wp-includes/taxonomy.php	(working copy)
@@ -391,6 +391,7 @@
 		'show_tagcloud'         => null,
 		'show_in_quick_edit'	=> null,
 		'show_admin_column'     => false,
+		'show_term_classes'     => true,
 		'meta_box_cb'           => null,
 		'capabilities'          => array(),
 		'rewrite'               => true,
