diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 65358c1866..9ef2e050c7 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -144,7 +144,7 @@ endif; ?>
@@ -184,7 +184,7 @@ if ( $page_links ) - + @@ -224,7 +224,7 @@ if ( $page_links ) - + @@ -278,7 +278,7 @@ if ( $page_links )

-

+

diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 145ee5ce22..ffaeee1b7c 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2073,17 +2073,32 @@ function js_escape($text) { /** * Escaping for HTML attributes. * - * @since 2.0.6 + * @since 2.8.0 * * @param string $text * @return string */ -function attribute_escape( $text ) { +function attr( $text ) { $safe_text = wp_check_invalid_utf8( $text ); $safe_text = wp_specialchars( $safe_text, ENT_QUOTES ); return apply_filters( 'attribute_escape', $safe_text, $text ); } +/** + * Escaping for HTML attributes. + * + * @since 2.0.6 + * + * @deprecated 2.8.0 + * @see attr() + * + * @param string $text + * @return string + */ +function attribute_escape( $text ) { + return attr( $text ); +} + /** * Escape a HTML tag name. * diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 8310a58211..44ec2eae3d 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -105,6 +105,22 @@ function __( $text, $domain = 'default' ) { return translate( $text, $domain ); } +/** + * Retrieves the translation of $text and escapes it for safe use in an attribute. + * If there is no translation, or the domain isn't loaded the original text is returned. + * + * @see translate() An alias of translate() + * @see attr() + * @since 2.8.0 + * + * @param string $text Text to translate + * @param string $domain Optional. Domain to retrieve the translated text + * @return string Translated text + */ +function _a( $text, $domain = 'default' ) { + return attr( translate( $text, $domain ) ); +} + /** * Displays the returned translated text from translate(). * @@ -118,6 +134,20 @@ function _e( $text, $domain = 'default' ) { echo translate( $text, $domain ); } +/** + * Displays translated text that has been escaped for safe use in an attribute. + * + * @see translate() Echos returned translate() string + * @see attr() + * @since 2.8.0 + * + * @param string $text Text to translate + * @param string $domain Optional. Domain to retrieve the translated text + */ +function _ea( $text, $domain = 'default' ) { + echo attr( translate( $text, $domain ) ); +} + /** * Retrieve translated string with vertical bar context * @@ -145,6 +175,10 @@ function _x( $single, $context, $domain = 'default' ) { return translate_with_gettext_context( $single, $context, $domain ); } +function _xa( $single, $context, $domain = 'default' ) { + return attr( translate_with_gettext_context( $single, $context, $domain ) ); +} + function __ngettext() { _deprecated_function( __FUNCTION__, '2.8', '_n()' ); $args = func_get_args();