Deprecate old l10n and sanitization APIs. Deprecate __ngettext() for _n(), __ngettext_noop() for _n_noop(), translate_with_context() for _x(). Deprecate sanitize_url for esc_url_raw, js_escape for esc_js, wp_specialchars for esc_html, attribute_escape for esc_attr. See #11388

git-svn-id: https://develop.svn.wordpress.org/trunk@13096 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-02-13 07:28:19 +00:00
parent 75705ed4c3
commit 0470fb90ea
3 changed files with 122 additions and 103 deletions

View File

@@ -1398,7 +1398,6 @@ function wp_rel_nofollow_callback( $matches ) {
return "<a $text rel=\"nofollow\">";
}
/**
* Convert one smiley code to the icon graphic file equivalent.
*
@@ -1429,7 +1428,6 @@ function translate_smiley($smiley) {
return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";
}
/**
* Convert text equivalent of smilies to images.
*
@@ -2226,7 +2224,6 @@ function esc_sql( $sql ) {
return $wpdb->escape( $sql );
}
/**
* Checks and cleans a URL.
*
@@ -2264,22 +2261,6 @@ function esc_url_raw( $url, $protocols = null ) {
return clean_url( $url, $protocols, 'db' );
}
/**
* Performs esc_url() for database or redirect usage.
*
* @see esc_url()
* @deprecated 2.8.0
*
* @since 2.3.1
*
* @param string $url The URL to be cleaned.
* @param array $protocols An array of acceptable protocols.
* @return string The cleaned URL.
*/
function sanitize_url( $url, $protocols = null ) {
return clean_url( $url, $protocols, 'db' );
}
/**
* Convert entities, while preserving already-encoded entities.
*
@@ -2317,23 +2298,6 @@ function esc_js( $text ) {
return apply_filters( 'js_escape', $safe_text, $text );
}
/**
* Escape single quotes, specialchar double quotes, and fix line endings.
*
* The filter 'js_escape' is also applied by esc_js()
*
* @since 2.0.4
*
* @deprecated 2.8.0
* @see esc_js()
*
* @param string $text The text to be escaped.
* @return string Escaped text.
*/
function js_escape( $text ) {
return esc_js( $text );
}
/**
* Escaping for HTML blocks.
*
@@ -2348,20 +2312,6 @@ function esc_html( $text ) {
return apply_filters( 'esc_html', $safe_text, $text );
}
/**
* Escaping for HTML blocks
* @deprecated 2.8.0
* @see esc_html()
*/
function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args
$args = func_get_args();
return call_user_func_array( '_wp_specialchars', $args );
} else {
return esc_html( $string );
}
}
/**
* Escaping for HTML attributes.
*
@@ -2376,21 +2326,6 @@ function esc_attr( $text ) {
return apply_filters( 'attribute_escape', $safe_text, $text );
}
/**
* Escaping for HTML attributes.
*
* @since 2.0.6
*
* @deprecated 2.8.0
* @see esc_attr()
*
* @param string $text
* @return string
*/
function attribute_escape( $text ) {
return esc_attr( $text );
}
/**
* Escape a HTML tag name.
*