Make WordPress Core

Ticket #9650: 9650.diff

File 9650.diff, 4.5 KB (added by ryan, 16 years ago)
  • wp-includes/l10n.php

     
    106106}
    107107
    108108/**
     109 * Retrieves the translation of $text and escapes it for safe use in an attribute.
     110 * If there is no translation, or the domain isn't loaded the original text is returned.
     111 *
     112 * @see translate() An alias of translate()
     113 * @see attr()
     114 * @since 2.8.0
     115 *
     116 * @param string $text Text to translate
     117 * @param string $domain Optional. Domain to retrieve the translated text
     118 * @return string Translated text
     119 */
     120function _a( $text, $domain = 'default' ) {
     121        return attr( translate( $text, $domain ) );
     122}
     123
     124/**
    109125 * Displays the returned translated text from translate().
    110126 *
    111127 * @see translate() Echos returned translate() string
     
    119135}
    120136
    121137/**
     138 * Displays translated text that has been escaped for safe use in an attribute.
     139 *
     140 * @see translate() Echos returned translate() string
     141 * @see attr()
     142 * @since 2.8.0
     143 *
     144 * @param string $text Text to translate
     145 * @param string $domain Optional. Domain to retrieve the translated text
     146 */
     147function _ea( $text, $domain = 'default' ) {
     148        echo attr( translate( $text, $domain ) );
     149}
     150
     151/**
    122152 * Retrieve translated string with vertical bar context
    123153 *
    124154 * Quite a few times, there will be collisions with similar translatable text
     
    145175        return translate_with_gettext_context( $single, $context, $domain );
    146176}
    147177
     178function _xa( $single, $context, $domain = 'default' ) {
     179        return attr( translate_with_gettext_context( $single, $context, $domain ) );
     180}
     181
    148182function __ngettext() {
    149183        _deprecated_function( __FUNCTION__, '2.8', '_n()' );
    150184        $args = func_get_args();
  • wp-includes/formatting.php

     
    20732073/**
    20742074 * Escaping for HTML attributes.
    20752075 *
    2076  * @since 2.0.6
     2076 * @since 2.8.0
    20772077 *
    20782078 * @param string $text
    20792079 * @return string
    20802080 */
    2081 function attribute_escape( $text ) {
     2081function attr( $text ) {
    20822082        $safe_text = wp_check_invalid_utf8( $text );
    20832083        $safe_text = wp_specialchars( $safe_text, ENT_QUOTES );
    20842084        return apply_filters( 'attribute_escape', $safe_text, $text );
    20852085}
    20862086
    20872087/**
     2088 * Escaping for HTML attributes.
     2089 *
     2090 * @since 2.0.6
     2091 *
     2092 * @deprecated 2.8.0
     2093 * @see attr()
     2094 *
     2095 * @param string $text
     2096 * @return string
     2097 */
     2098function attribute_escape( $text ) {
     2099        return attr( $text );
     2100}
     2101
     2102/**
    20882103 * Escape a HTML tag name.
    20892104 *
    20902105 * @since 2.5.0
  • wp-admin/categories.php

     
    144144<p class="search-box">
    145145        <label class="hidden" for="category-search-input"><?php _e('Search Categories'); ?>:</label>
    146146        <input type="text" id="category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
    147         <input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
     147        <input type="submit" value="<?php _ea( 'Search Categories' ); ?>" class="button" />
    148148</p>
    149149</form>
    150150<br class="clear" />
     
    184184<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
    185185<option value="delete"><?php _e('Delete'); ?></option>
    186186</select>
    187 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
     187<input type="submit" value="<?php _ea('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
    188188<?php wp_nonce_field('bulk-categories'); ?>
    189189</div>
    190190
     
    224224<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
    225225<option value="delete"><?php _e('Delete'); ?></option>
    226226</select>
    227 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
     227<input type="submit" value="<?php _ea('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
    228228<?php wp_nonce_field('bulk-categories'); ?>
    229229</div>
    230230
     
    278278    <p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
    279279</div>
    280280
    281 <p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Category'); ?>" /></p>
     281<p class="submit"><input type="submit" class="button" name="submit" value="<?php _ea('Add Category'); ?>" /></p>
    282282<?php do_action('edit_category_form', $category); ?>
    283283</form></div>
    284284