diff --git src/wp-includes/l10n.php src/wp-includes/l10n.php
index c637774..3ffd6e8 100644
--- src/wp-includes/l10n.php
+++ src/wp-includes/l10n.php
@@ -348,6 +348,42 @@ function _n( $single, $plural, $number, $domain = 'default' ) {
 }
 
 /**
+ * Translates and retrieves the singular or plural form based on the supplied number
+ * and escapes it for safe use in HTML output.
+ *
+ * @since 4.7.0
+ *
+ * @param string $single The text to be used if the number is singular.
+ * @param string $plural The text to be used if the number is plural.
+ * @param int    $number The number to compare against to use either the singular or plural form.
+ * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
+ *                       Default 'default'.
+ *
+ * @return string Translated text.
+ */
+function esc_html_n( $single, $plural, $number, $domain = 'default' ) {
+	return esc_html( _n( $single, $plural, $number, $domain = 'default' ) );
+}
+
+/**
+ * Translates and retrieves the singular or plural form based on the supplied number
+ * and escapes it for safe use in an attribute.
+ *
+ * @since 4.7.0
+ *
+ * @param string $single The text to be used if the number is singular.
+ * @param string $plural The text to be used if the number is plural.
+ * @param int    $number The number to compare against to use either the singular or plural form.
+ * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings.
+ *                       Default 'default'.
+ *
+ * @return string Translated text.
+ */
+function esc_attr_n( $single, $plural, $number, $domain = 'default' ) {
+	return esc_attr( _n( $single, $plural, $number, $domain = 'default' ) );
+}
+
+/**
  * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
  *
  * This is a hybrid of _n() and _x(). It supports context and plurals.
