Changeset 13096
- Timestamp:
- 02/13/2010 07:28:19 AM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r13093 r13096 1863 1863 function _c( $text, $domain = 'default' ) { 1864 1864 _deprecated_function( __FUNCTION__, '2.9', '_x()' ); 1865 return translate_with_context( $text, $domain ); 1865 return before_last_bar( translate( $text, $domain ) ); 1866 } 1867 1868 /** 1869 * Translates $text like translate(), but assumes that the text 1870 * contains a context after its last vertical bar. 1871 * 1872 * @since 2.5 1873 * @uses translate() 1874 * @deprecated 3.0.0 1875 * @deprecated Use _x() 1876 * @see _x() 1877 * 1878 * @param string $text Text to translate 1879 * @param string $domain Domain to retrieve the translated text 1880 * @return string Translated text 1881 */ 1882 function translate_with_context( $text, $domain = 'default' ) { 1883 _deprecated_function( __FUNCTION__, '2.9', '_x()' ); 1884 return before_last_bar( translate( $text, $domain ) ); 1866 1885 } 1867 1886 … … 1881 1900 _deprecated_function( __FUNCTION__, '2.9', '_nx()' ); 1882 1901 return before_last_bar( _n( $single, $plural, $number, $domain ) ); 1902 } 1903 1904 /** 1905 * Retrieve the plural or single form based on the amount. 1906 * 1907 * @since 1.2.0 1908 * @deprecated 2.8.0 1909 * @deprecated Use _n() 1910 * @see _n() 1911 */ 1912 function __ngettext() { 1913 _deprecated_function( __FUNCTION__, '2.8', '_n()' ); 1914 $args = func_get_args(); 1915 return call_user_func_array('_n', $args); 1916 } 1917 1918 /** 1919 * Register plural strings in POT file, but don't translate them. 1920 * 1921 * @since 2.5 1922 * @deprecated 2.8.0 1923 * @deprecated Use _n_noop() 1924 * @see _n_noop() 1925 */ 1926 function __ngettext_noop() { 1927 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' ); 1928 $args = func_get_args(); 1929 return call_user_func_array('_n_noop', $args); 1930 1883 1931 } 1884 1932 … … 2075 2123 } 2076 2124 2125 /** 2126 * Performs esc_url() for database or redirect usage. 2127 * 2128 * @since 2.3.1 2129 * @deprecated 2.8.0 2130 * @deprecated Use esc_url_raw() 2131 * @see esc_url_raw() 2132 * 2133 * @param string $url The URL to be cleaned. 2134 * @param array $protocols An array of acceptable protocols. 2135 * @return string The cleaned URL. 2136 */ 2137 function sanitize_url( $url, $protocols = null ) { 2138 _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' ); 2139 return clean_url( $url, $protocols, 'db' ); 2140 } 2141 2142 /** 2143 * Escape single quotes, specialchar double quotes, and fix line endings. 2144 * 2145 * The filter 'js_escape' is also applied by esc_js() 2146 * 2147 * @since 2.0.4 2148 * @deprecated 2.8.0 2149 * @deprecated Use esc_js() 2150 * @see esc_js() 2151 * 2152 * @param string $text The text to be escaped. 2153 * @return string Escaped text. 2154 */ 2155 function js_escape( $text ) { 2156 _deprecated_function( __FUNCTION__, '2.8', 'esc_js()' ); 2157 return esc_js( $text ); 2158 } 2159 2160 /** 2161 * Escaping for HTML blocks. 2162 * 2163 * @deprecated 2.8.0 2164 * @deprecated Use esc_html() 2165 * @see esc_html() 2166 */ 2167 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { 2168 _deprecated_function( __FUNCTION__, '2.8', 'esc_html()' ); 2169 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args 2170 $args = func_get_args(); 2171 return call_user_func_array( '_wp_specialchars', $args ); 2172 } else { 2173 return esc_html( $string ); 2174 } 2175 } 2176 2177 2178 /** 2179 * Escaping for HTML attributes. 2180 * 2181 * @since 2.0.6 2182 * @deprecated 2.8.0 2183 * @deprecated Use esc_attr() 2184 * @see esc_attr() 2185 * 2186 * @param string $text 2187 * @return string 2188 */ 2189 function attribute_escape( $text ) { 2190 _deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' ); 2191 return esc_attr( $text ); 2192 } 2193 2077 2194 ?> -
trunk/wp-includes/formatting.php
r13089 r13096 1399 1399 } 1400 1400 1401 1402 1401 /** 1403 1402 * Convert one smiley code to the icon graphic file equivalent. … … 1429 1428 return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> "; 1430 1429 } 1431 1432 1430 1433 1431 /** … … 2227 2225 } 2228 2226 2229 2230 2227 /** 2231 2228 * Checks and cleans a URL. … … 2262 2259 */ 2263 2260 function esc_url_raw( $url, $protocols = null ) { 2264 return clean_url( $url, $protocols, 'db' );2265 }2266 2267 /**2268 * Performs esc_url() for database or redirect usage.2269 *2270 * @see esc_url()2271 * @deprecated 2.8.02272 *2273 * @since 2.3.12274 *2275 * @param string $url The URL to be cleaned.2276 * @param array $protocols An array of acceptable protocols.2277 * @return string The cleaned URL.2278 */2279 function sanitize_url( $url, $protocols = null ) {2280 2261 return clean_url( $url, $protocols, 'db' ); 2281 2262 } … … 2319 2300 2320 2301 /** 2321 * Escape single quotes, specialchar double quotes, and fix line endings.2322 *2323 * The filter 'js_escape' is also applied by esc_js()2324 *2325 * @since 2.0.42326 *2327 * @deprecated 2.8.02328 * @see esc_js()2329 *2330 * @param string $text The text to be escaped.2331 * @return string Escaped text.2332 */2333 function js_escape( $text ) {2334 return esc_js( $text );2335 }2336 2337 /**2338 2302 * Escaping for HTML blocks. 2339 2303 * … … 2350 2314 2351 2315 /** 2352 * Escaping for HTML blocks2353 * @deprecated 2.8.02354 * @see esc_html()2355 */2356 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {2357 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args2358 $args = func_get_args();2359 return call_user_func_array( '_wp_specialchars', $args );2360 } else {2361 return esc_html( $string );2362 }2363 }2364 2365 /**2366 2316 * Escaping for HTML attributes. 2367 2317 * … … 2375 2325 $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES ); 2376 2326 return apply_filters( 'attribute_escape', $safe_text, $text ); 2377 }2378 2379 /**2380 * Escaping for HTML attributes.2381 *2382 * @since 2.0.62383 *2384 * @deprecated 2.8.02385 * @see esc_attr()2386 *2387 * @param string $text2388 * @return string2389 */2390 function attribute_escape( $text ) {2391 return esc_attr( $text );2392 2327 } 2393 2328 -
trunk/wp-includes/l10n.php
r12988 r13096 78 78 } 79 79 80 /**81 * Translates $text like translate(), but assumes that the text82 * contains a context after its last vertical bar.83 *84 * @since 2.585 * @uses translate()86 *87 * @param string $text Text to translate88 * @param string $domain Domain to retrieve the translated text89 * @return string Translated text90 */91 function translate_with_context( $text, $domain = 'default' ) {92 return before_last_bar( translate( $text, $domain ) );93 }94 95 80 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 96 81 $translations = &get_translations_for_domain( $domain ); … … 193 178 * 194 179 * By including the context in the pot file translators can translate the two 195 * string differently 196 * 197 * @since 2.8 180 * string differently. 181 * 182 * @since 2.8.0 198 183 * 199 184 * @param string $text Text to translate … … 202 187 * @return string Translated context string without pipe 203 188 */ 204 205 189 function _x( $single, $context, $domain = 'default' ) { 206 190 return translate_with_gettext_context( $single, $context, $domain ); … … 213 197 function esc_html_x( $single, $context, $domain = 'default' ) { 214 198 return esc_html( translate_with_gettext_context( $single, $context, $domain ) ); 215 }216 217 function __ngettext() {218 _deprecated_function( __FUNCTION__, '2.8', '_n()' );219 $args = func_get_args();220 return call_user_func_array('_n', $args);221 199 } 222 200 … … 232 210 * type will be a string. 233 211 * 234 * @since 1.2.0212 * @since 2.8.0 235 213 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 236 214 * @uses apply_filters() Calls 'ngettext' hook on domains text returned, … … 260 238 $translation = $translations->translate_plural( $single, $plural, $number, $context ); 261 239 return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain ); 262 }263 264 /**265 * @deprecated Use _n_noop()266 */267 function __ngettext_noop() {268 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' );269 $args = func_get_args();270 return call_user_func_array('_n_noop', $args);271 272 240 } 273 241 … … 305 273 } 306 274 307 308 275 /** 309 276 * Loads a MO file into the domain $domain.
Note: See TracChangeset
for help on using the changeset viewer.