Index: src/wp-includes/kses.php
===================================================================
--- src/wp-includes/kses.php	(revision 43690)
+++ src/wp-includes/kses.php	(working copy)
@@ -867,6 +867,17 @@
 	$allowed_attr = $allowed_html[strtolower( $element )];
 
 	$name_low = strtolower( $name );
+
+	// Allow `data-*` attributes.
+	// When filtering or specifying `$allowed_html`, the attribute name should be set as `data-*`
+	// (not to be mixed with the HTML 4.0 `data` attribute, see https://www.w3.org/TR/html40/struct/objects.html#adef-data).
+	// Note: the attribute name should only contain `A-Za-z0-9_-` chars.
+	if ( ! empty( $allowed_attr['data-*'] ) && preg_match( '/^data-[a-z0-9_-]+$/', $name_low, $match ) ) {
+		// Add the whole attribute name to the allowed attributes and set any restrictions
+		// for all `data-*` attribute values for this element.
+		$allowed_attr[ $match[0] ] = $allowed_attr['data-*'];
+	}
+
 	if ( ! isset( $allowed_attr[$name_low] ) || '' == $allowed_attr[$name_low] ) {
 		$name = $value = $whole = '';
 		return false;
@@ -1820,6 +1831,7 @@
 		'style' => true,
 		'title' => true,
 		'role' => true,
+		'data-*' => true,
 	);
 
 	if ( true === $value )
