Ticket #11388: 11388.4.diff
File 11388.4.diff, 37.9 KB (added by , 15 years ago) |
---|
-
wp-includes/post-template.php
949 949 } 950 950 951 951 /** 952 * Retrieve HTML content of attachment image with link.953 *954 * @since 2.0.0955 * @deprecated Use {@link wp_get_attachment_link()}956 * @see wp_get_attachment_link() Use instead.957 *958 * @param int $id Optional. Post ID.959 * @param bool $fullsize Optional, default is false. Whether to use full size image.960 * @param array $max_dims Optional. Max image dimensions.961 * @param bool $permalink Optional, default is false. Whether to include permalink to image.962 * @return string963 */964 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {965 $id = (int) $id;966 $_post = & get_post($id);967 968 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )969 return __('Missing Attachment');970 971 if ( $permalink )972 $url = get_attachment_link($_post->ID);973 974 $post_title = esc_attr($_post->post_title);975 976 $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);977 return "<a href='$url' title='$post_title'>$innerHTML</a>";978 }979 980 /**981 * Retrieve icon URL and Path.982 *983 * @since 2.1.0984 * @deprecated Use {@link wp_get_attachment_image_src()}985 * @see wp_get_attachment_image_src() Use instead.986 *987 * @param int $id Optional. Post ID.988 * @param bool $fullsize Optional, default to false. Whether to have full image.989 * @return array Icon URL and full path to file, respectively.990 */991 function get_attachment_icon_src( $id = 0, $fullsize = false ) {992 $id = (int) $id;993 if ( !$post = & get_post($id) )994 return false;995 996 $file = get_attached_file( $post->ID );997 998 if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {999 // We have a thumbnail desired, specified and existing1000 1001 $src_file = basename($src);1002 $class = 'attachmentthumb';1003 } elseif ( wp_attachment_is_image( $post->ID ) ) {1004 // We have an image without a thumbnail1005 1006 $src = wp_get_attachment_url( $post->ID );1007 $src_file = & $file;1008 $class = 'attachmentimage';1009 } elseif ( $src = wp_mime_type_icon( $post->ID ) ) {1010 // No thumb, no image. We'll look for a mime-related icon instead.1011 1012 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );1013 $src_file = $icon_dir . '/' . basename($src);1014 }1015 1016 if ( !isset($src) || !$src )1017 return false;1018 1019 return array($src, $src_file);1020 }1021 1022 /**1023 * Retrieve HTML content of icon attachment image element.1024 *1025 * @since 2.0.01026 * @deprecated Use {@link wp_get_attachment_image()}1027 * @see wp_get_attachment_image() Use instead of.1028 *1029 * @param int $id Optional. Post ID.1030 * @param bool $fullsize Optional, default to false. Whether to have full size image.1031 * @param array $max_dims Optional. Dimensions of image.1032 * @return string HTML content.1033 */1034 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {1035 $id = (int) $id;1036 if ( !$post = & get_post($id) )1037 return false;1038 1039 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )1040 return false;1041 1042 list($src, $src_file) = $src;1043 1044 // Do we need to constrain the image?1045 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {1046 1047 $imagesize = getimagesize($src_file);1048 1049 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {1050 $actual_aspect = $imagesize[0] / $imagesize[1];1051 $desired_aspect = $max_dims[0] / $max_dims[1];1052 1053 if ( $actual_aspect >= $desired_aspect ) {1054 $height = $actual_aspect * $max_dims[0];1055 $constraint = "width='{$max_dims[0]}' ";1056 $post->iconsize = array($max_dims[0], $height);1057 } else {1058 $width = $max_dims[1] / $actual_aspect;1059 $constraint = "height='{$max_dims[1]}' ";1060 $post->iconsize = array($width, $max_dims[1]);1061 }1062 } else {1063 $post->iconsize = array($imagesize[0], $imagesize[1]);1064 $constraint = '';1065 }1066 } else {1067 $constraint = '';1068 }1069 1070 $post_title = esc_attr($post->post_title);1071 1072 $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";1073 1074 return apply_filters( 'attachment_icon', $icon, $post->ID );1075 }1076 1077 /**1078 * Retrieve HTML content of image element.1079 *1080 * @since 2.0.01081 * @deprecated Use {@link wp_get_attachment_image()}1082 * @see wp_get_attachment_image() Use instead.1083 *1084 * @param int $id Optional. Post ID.1085 * @param bool $fullsize Optional, default to false. Whether to have full size image.1086 * @param array $max_dims Optional. Dimensions of image.1087 * @return string1088 */1089 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {1090 $id = (int) $id;1091 if ( !$post = & get_post($id) )1092 return false;1093 1094 if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))1095 return $innerHTML;1096 1097 1098 $innerHTML = esc_attr($post->post_title);1099 1100 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);1101 }1102 1103 /**1104 952 * Wrap attachment in <<p>> element before content. 1105 953 * 1106 954 * @since 2.0.0 -
wp-includes/l10n.php
67 67 return substr( $string, 0, $last_bar ); 68 68 } 69 69 70 /**71 * Translates $text like translate(), but assumes that the text72 * contains a context after its last vertical bar.73 *74 * @since 2.575 * @uses translate()76 *77 * @param string $text Text to translate78 * @param string $domain Domain to retrieve the translated text79 * @return string Translated text80 */81 function translate_with_context( $text, $domain = 'default' ) {82 return before_last_bar( translate( $text, $domain ) );83 }84 85 70 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 86 71 $translations = &get_translations_for_domain( $domain ); 87 72 return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain ); … … 204 189 return esc_html( translate_with_gettext_context( $single, $context, $domain ) ); 205 190 } 206 191 207 function __ngettext() {208 _deprecated_function( __FUNCTION__, '2.8', '_n()' );209 $args = func_get_args();210 return call_user_func_array('_n', $args);211 }212 213 192 /** 214 193 * Retrieve the plural or single form based on the amount. 215 194 * … … 221 200 * to the 'ngettext' filter hook along with the same parameters. The expected 222 201 * type will be a string. 223 202 * 224 * @since 1.2.0203 * @since 2.8.0 225 204 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 226 205 * @uses apply_filters() Calls 'ngettext' hook on domains text returned, 227 206 * along with $single, $plural, and $number parameters. Expected to return string. … … 252 231 } 253 232 254 233 /** 255 * @deprecated Use _n_noop()256 */257 function __ngettext_noop() {258 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' );259 $args = func_get_args();260 return call_user_func_array('_n_noop', $args);261 262 }263 264 /**265 234 * Register plural strings in POT file, but don't translate them. 266 235 * 267 236 * Used when you want do keep structures with translatable plural strings and … … 276 245 * $message = $messages[$type]; 277 246 * $usable_text = sprintf(_n($message[0], $message[1], $count), $count); 278 247 * 279 * @since 2. 5248 * @since 2.8.0 280 249 * @param $single Single form to be i18ned 281 250 * @param $plural Plural form to be i18ned 282 251 * @return array array($single, $plural) -
wp-includes/bookmark.php
80 80 } 81 81 82 82 /** 83 * Retrieve bookmark data based on ID.84 *85 * @since 2.0.086 * @deprecated Use get_bookmark()87 * @see get_bookmark()88 *89 * @param int $bookmark_id ID of link90 * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A91 * @return object|array92 */93 function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {94 return get_bookmark($bookmark_id, $output, $filter);95 }96 97 /**98 83 * Retrieves the list of bookmarks 99 84 * 100 85 * Attempts to retrieve from the cache first based on MD5 hash of arguments. If -
wp-includes/formatting.php
2265 2265 } 2266 2266 2267 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 return clean_url( $url, $protocols, 'db' );2281 }2282 2283 /**2284 2268 * Convert entities, while preserving already-encoded entities. 2285 2269 * 2286 2270 * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes. … … 2318 2302 } 2319 2303 2320 2304 /** 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 2305 * Escaping for HTML blocks. 2339 2306 * 2340 2307 * @since 2.8.0 … … 2349 2316 } 2350 2317 2351 2318 /** 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 2319 * Escaping for HTML attributes. 2367 2320 * 2368 2321 * @since 2.8.0 … … 2377 2330 } 2378 2331 2379 2332 /** 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 }2393 2394 /**2395 2333 * Escape a HTML tag name. 2396 2334 * 2397 2335 * @since 2.5.0 -
wp-includes/deprecated.php
125 125 function start_wp() { 126 126 global $wp_query, $post; 127 127 128 _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') 128 _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') ); 129 129 130 130 // Since the old style loop is being used, advance the query iterator here. 131 131 $wp_query->next_post(); … … 487 487 * Gets the links associated with the named category. 488 488 * 489 489 * @since 1.0.1 490 * @deprecated 2.1 490 491 * @deprecated Use wp_list_bookmarks() 491 492 * @see wp_list_bookmarks() 492 493 * … … 495 496 * @return bool|null 496 497 */ 497 498 function wp_get_linksbyname($category, $args = '') { 498 _deprecated_function( __FUNCTION__, '0.0', 'wp_list_bookmarks()');499 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); 499 500 500 501 $defaults = array( 501 502 'after' => '<br />', … … 661 662 * Gets the auto_toggle setting. 662 663 * 663 664 * @since 0.71 665 * @deprecated 2.1 664 666 * @deprecated No alternative function available 665 667 * 666 668 * @param int $id The category to get. If no category supplied uses 0 667 669 * @return int Only returns 0. 668 670 */ 669 671 function get_autotoggle($id = 0) { 670 _deprecated_function( __FUNCTION__, '2.1' 672 _deprecated_function( __FUNCTION__, '2.1' ); 671 673 return 0; 672 674 } 673 675 … … 741 743 742 744 /** 743 745 * @since 0.71 746 * @deprecated 2.1 744 747 * @deprecated Use wp_dropdown_categories() 745 748 * @see wp_dropdown_categories() 746 749 * … … 776 779 } 777 780 778 781 /** 782 * {@internal Missing Short Description}} 783 * 784 * @since unknown 785 * @deprecated 2.6.0 786 * @deprecated Use wp_category_checklist() 787 * @see wp_category_checklist() 788 * 789 * @param unknown_type $default 790 * @param unknown_type $parent 791 * @param unknown_type $popular_ids 792 */ 793 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { 794 _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' ); 795 global $post_ID; 796 wp_category_checklist($post_ID); 797 } 798 799 /** 800 * {@internal Missing Short Description}} 801 * 802 * @since unknown 803 * @deprecated 2.6.0 804 * @deprecated Use wp_link_category_checklist() 805 * @see wp_link_category_checklist() 806 * 807 * @param unknown_type $default 808 */ 809 function dropdown_link_categories( $default = 0 ) { 810 _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' ); 811 global $link_id; 812 wp_link_category_checklist($link_id); 813 } 814 815 /** 816 * Display the HTML dropdown list of categories. 817 * 818 * @since unknown 819 * @deprecated 2.1.0 820 * @deprecated Use wp_dropdown_categories() 821 * @see wp_dropdown_categories() 822 * 823 * @param unknown_type $currentcat 824 * @param unknown_type $currentparent 825 * @param unknown_type $parent 826 * @param unknown_type $level 827 * @param unknown_type $categories 828 * @return unknown 829 */ 830 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) { 831 _deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' ); 832 if (!$categories ) 833 $categories = get_categories( array('hide_empty' => 0) ); 834 835 if ( $categories ) { 836 foreach ( $categories as $category ) { 837 if ( $currentcat != $category->term_id && $parent == $category->parent) { 838 $pad = str_repeat( '– ', $level ); 839 $category->name = esc_html( $category->name ); 840 echo "\n\t<option value='$category->term_id'"; 841 if ( $currentparent == $category->term_id ) 842 echo " selected='selected'"; 843 echo ">$pad$category->name</option>"; 844 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories ); 845 } 846 } 847 } else { 848 return false; 849 } 850 } 851 852 /** 779 853 * @since 2.1 780 854 * @deprecated 2.1 781 855 * @deprecated Use wp_tiny_mce(). … … 943 1017 * Print the permalink to the RSS feed. 944 1018 * 945 1019 * @since 0.71 1020 * @deprecated 2.3 946 1021 * @deprecated Use the_permalink_rss() 947 1022 * @see the_permalink_rss() 948 1023 * 949 1024 * @param string $file 950 1025 */ 951 1026 function permalink_single_rss($deprecated = '') { 952 _deprecated_function( __FUNCTION__, '0.0', 'the_permalink_rss()');1027 _deprecated_function( __FUNCTION__, '2.3', 'the_permalink_rss()' ); 953 1028 the_permalink_rss(); 954 1029 } 955 1030 956 1031 /** 1032 * Retrieve bookmark data based on ID. 1033 * 1034 * @since 2.0.0 1035 * @deprecated 2.1.0 1036 * @deprecated Use get_bookmark() 1037 * @see get_bookmark() 1038 * 1039 * @param int $bookmark_id ID of link 1040 * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A 1041 * @return object|array 1042 */ 1043 function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') { 1044 _deprecated_function( __FUNCTION__, '2.1', 'get_bookmark()' ); 1045 return get_bookmark($bookmark_id, $output, $filter); 1046 } 1047 1048 /** 957 1049 * Gets the links associated with category. 958 1050 * 959 * @see get_links() for argument information that can be used in $args960 1051 * @since 1.0.1 961 * @deprecated Use get_bookmarks() 962 * @see get_bookmarks() 1052 * @deprecated 2.1 1053 * @deprecated Use wp_list_bookmarks() 1054 * @see wp_list_bookmarks() 963 1055 * 964 1056 * @param string $args a query string 965 1057 * @return null|string 966 1058 */ 967 1059 function wp_get_links($args = '') { 968 _deprecated_function( __FUNCTION__, '0.0', 'wp_list_bookmarks()');1060 _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); 969 1061 970 1062 if ( strpos( $args, '=' ) === false ) { 971 1063 $cat_id = $args; … … 997 1089 * Gets the links associated with category by id. 998 1090 * 999 1091 * @since 0.71 1092 * @deprecated 2.1 1000 1093 * @deprecated Use get_bookmarks() 1001 1094 * @see get_bookmarks() 1002 1095 * … … 1162 1255 * @param bool $count the number of links in the db 1163 1256 */ 1164 1257 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { 1165 _deprecated_function( __FUNCTION__, '2.1' 1258 _deprecated_function( __FUNCTION__, '2.1' ); 1166 1259 1167 1260 if ( $count ) 1168 1261 $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); … … 1320 1413 * 1321 1414 */ 1322 1415 function documentation_link() { 1323 _deprecated_function( __FUNCTION__, '2.5' , '');1416 _deprecated_function( __FUNCTION__, '2.5' ); 1324 1417 return; 1325 1418 } 1326 1419 1327 1420 /** 1328 1421 * Unused function. 1329 1422 * 1423 * @since unknown 1330 1424 * @deprecated 2.5 1331 1425 */ 1332 1426 function gzip_compression() { 1333 _deprecated_function( __FUNCTION__, '2.5' , '');1427 _deprecated_function( __FUNCTION__, '2.5' ); 1334 1428 return false; 1335 1429 } 1336 1430 … … 1417 1511 * @return string The author's description. 1418 1512 */ 1419 1513 function get_the_author_description() { 1420 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' 1514 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' ); 1421 1515 return get_the_author_meta('description'); 1422 1516 } 1423 1517 … … 1430 1524 * @see the_author_meta() 1431 1525 */ 1432 1526 function the_author_description() { 1433 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' 1527 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' ); 1434 1528 the_author_meta('description'); 1435 1529 } 1436 1530 … … 1445 1539 * @return string The author's login name (username). 1446 1540 */ 1447 1541 function get_the_author_login() { 1448 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' 1542 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' ); 1449 1543 return get_the_author_meta('login'); 1450 1544 } 1451 1545 … … 1458 1552 * @see the_author_meta() 1459 1553 */ 1460 1554 function the_author_login() { 1461 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' 1555 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' ); 1462 1556 the_author_meta('login'); 1463 1557 } 1464 1558 … … 1473 1567 * @return string The author's first name. 1474 1568 */ 1475 1569 function get_the_author_firstname() { 1476 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' 1570 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' ); 1477 1571 return get_the_author_meta('first_name'); 1478 1572 } 1479 1573 … … 1486 1580 * @see the_author_meta() 1487 1581 */ 1488 1582 function the_author_firstname() { 1489 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' 1583 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' ); 1490 1584 the_author_meta('first_name'); 1491 1585 } 1492 1586 … … 1501 1595 * @return string The author's last name. 1502 1596 */ 1503 1597 function get_the_author_lastname() { 1504 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' 1598 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' ); 1505 1599 return get_the_author_meta('last_name'); 1506 1600 } 1507 1601 … … 1514 1608 * @see the_author_meta() 1515 1609 */ 1516 1610 function the_author_lastname() { 1517 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' 1611 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' ); 1518 1612 the_author_meta('last_name'); 1519 1613 } 1520 1614 … … 1529 1623 * @return string The author's nickname. 1530 1624 */ 1531 1625 function get_the_author_nickname() { 1532 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' 1626 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); 1533 1627 return get_the_author_meta('nickname'); 1534 1628 } 1535 1629 … … 1542 1636 * @see the_author_meta() 1543 1637 */ 1544 1638 function the_author_nickname() { 1545 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' 1639 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); 1546 1640 the_author_meta('nickname'); 1547 1641 } 1548 1642 … … 1557 1651 * @return string The author's username. 1558 1652 */ 1559 1653 function get_the_author_email() { 1560 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' 1654 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); 1561 1655 return get_the_author_meta('email'); 1562 1656 } 1563 1657 … … 1570 1664 * @see the_author_meta() 1571 1665 */ 1572 1666 function the_author_email() { 1573 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' 1667 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); 1574 1668 the_author_meta('email'); 1575 1669 } 1576 1670 … … 1585 1679 * @return string The author's ICQ number. 1586 1680 */ 1587 1681 function get_the_author_icq() { 1588 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' 1682 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); 1589 1683 return get_the_author_meta('icq'); 1590 1684 } 1591 1685 … … 1598 1692 * @see the_author_meta() 1599 1693 */ 1600 1694 function the_author_icq() { 1601 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' 1695 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); 1602 1696 the_author_meta('icq'); 1603 1697 } 1604 1698 … … 1613 1707 * @return string The author's Yahoo! IM name. 1614 1708 */ 1615 1709 function get_the_author_yim() { 1616 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' 1710 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); 1617 1711 return get_the_author_meta('yim'); 1618 1712 } 1619 1713 … … 1626 1720 * @see the_author_meta() 1627 1721 */ 1628 1722 function the_author_yim() { 1629 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' 1723 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); 1630 1724 the_author_meta('yim'); 1631 1725 } 1632 1726 … … 1641 1735 * @return string The author's MSN address. 1642 1736 */ 1643 1737 function get_the_author_msn() { 1644 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' 1738 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); 1645 1739 return get_the_author_meta('msn'); 1646 1740 } 1647 1741 … … 1654 1748 * @see the_author_meta() 1655 1749 */ 1656 1750 function the_author_msn() { 1657 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' 1751 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); 1658 1752 the_author_meta('msn'); 1659 1753 } 1660 1754 … … 1669 1763 * @return string The author's AIM address. 1670 1764 */ 1671 1765 function get_the_author_aim() { 1672 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' 1766 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); 1673 1767 return get_the_author_meta('aim'); 1674 1768 } 1675 1769 … … 1682 1776 * @deprecated Use the_author_meta('aim') 1683 1777 */ 1684 1778 function the_author_aim() { 1685 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' 1779 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); 1686 1780 the_author_meta('aim'); 1687 1781 } 1688 1782 … … 1698 1792 * @return string The author's display name. 1699 1793 */ 1700 1794 function get_author_name( $auth_id = false ) { 1701 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' 1795 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); 1702 1796 return get_the_author_meta('display_name', $auth_id); 1703 1797 } 1704 1798 … … 1713 1807 * @return string The URL to the author's page. 1714 1808 */ 1715 1809 function get_the_author_url() { 1716 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' 1810 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); 1717 1811 return get_the_author_meta('url'); 1718 1812 } 1719 1813 … … 1726 1820 * @see the_author_meta() 1727 1821 */ 1728 1822 function the_author_url() { 1729 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' 1823 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); 1730 1824 the_author_meta('url'); 1731 1825 } 1732 1826 … … 1741 1835 * @return int The author's ID. 1742 1836 */ 1743 1837 function get_the_author_ID() { 1744 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' 1838 _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); 1745 1839 return get_the_author_meta('ID'); 1746 1840 } 1747 1841 … … 1754 1848 * @see the_author_meta() 1755 1849 */ 1756 1850 function the_author_ID() { 1757 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' 1851 _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); 1758 1852 the_author_meta('ID'); 1759 1853 } 1760 1854 … … 1793 1887 * @param int $encode_html Optional. How to encode the content. 1794 1888 */ 1795 1889 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { 1796 _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed ');1890 _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed()' ); 1797 1891 $content = get_the_content($more_link_text, $stripteaser, $more_file); 1798 1892 $content = apply_filters('the_content_rss', $content); 1799 1893 if ( $cut && !$encode_html ) … … 1839 1933 * @return string HTML stripped out of content with links at the bottom. 1840 1934 */ 1841 1935 function make_url_footnote( $content ) { 1842 _deprecated_function( __FUNCTION__, '2.9' , '');1936 _deprecated_function( __FUNCTION__, '2.9' ); 1843 1937 preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches ); 1844 1938 $links_summary = "\n"; 1845 1939 for ( $i=0; $i<count($matches[0]); $i++ ) { … … 1857 1951 } 1858 1952 1859 1953 /** 1954 * Retrieve the plural or single form based on the amount. 1955 * 1956 * @since 2.1.0 1957 * @deprecated 2.8.0 1958 * @deprecated Use _n() 1959 * @see _n() 1960 */ 1961 function __ngettext() { 1962 _deprecated_function( __FUNCTION__, '2.8', '_n()' ); 1963 $args = func_get_args(); 1964 return call_user_func_array('_n', $args); 1965 } 1966 1967 /** 1968 * Register plural strings in POT file, but don't translate them. 1969 * 1970 * @since 2.5.0 1971 * @deprecated 2.8.0 1972 * @deprecated Use _n_noop() 1973 * @see _n_noop() 1974 */ 1975 function __ngettext_noop() { 1976 _deprecated_function( __FUNCTION__, '2.8', '_n_noop()' ); 1977 $args = func_get_args(); 1978 return call_user_func_array('_n_noop', $args); 1979 1980 } 1981 1982 /** 1860 1983 * Retrieve translated string with vertical bar context 1861 1984 * 1862 1985 * Quite a few times, there will be collisions with similar translatable text … … 1879 2002 * @return string Translated context string without pipe 1880 2003 */ 1881 2004 function _c( $text, $domain = 'default' ) { 1882 _deprecated_function( __FUNCTION__, '2.9', '_x' );1883 return translate_with_context( $text, $domain);2005 _deprecated_function( __FUNCTION__, '2.9', '_x()' ); 2006 return before_last_bar( translate( $text, $domain ) ); 1884 2007 } 1885 2008 1886 2009 /** … … 1896 2019 * 1897 2020 */ 1898 2021 function _nc( $single, $plural, $number, $domain = 'default' ) { 1899 _deprecated_function( __FUNCTION__, '2.9', '_nx' );2022 _deprecated_function( __FUNCTION__, '3.0', '_nx()' ); 1900 2023 return before_last_bar( _n( $single, $plural, $number, $domain ) ); 1901 2024 } 1902 ?> 2025 2026 /** 2027 * Translates $text like translate(), but assumes that the text 2028 * contains a context after its last vertical bar. 2029 * 2030 * @since 2.5 2031 * @deprecated 3.0.0 2032 * @deprecated Use _x() 2033 * @see _x() 2034 * @uses translate() 2035 * 2036 * @param string $text Text to translate 2037 * @param string $domain Domain to retrieve the translated text 2038 * @return string Translated text 2039 */ 2040 function translate_with_context( $text, $domain = 'default' ) {f 2041 2042 _deprecated_function( __FUNCTION__, '3.0', '_x()' ); 2043 return before_last_bar( translate( $text, $domain ) ); 2044 } 2045 2046 /** 2047 * Retrieve HTML content of attachment image with link. 2048 * 2049 * @since 2.0.0 2050 * @deprecated 2.5.0 2051 * @deprecated Use wp_get_attachment_link() 2052 * @see wp_get_attachment_link() 2053 * 2054 * @param int $id Optional. Post ID. 2055 * @param bool $fullsize Optional, default is false. Whether to use full size image. 2056 * @param array $max_dims Optional. Max image dimensions. 2057 * @param bool $permalink Optional, default is false. Whether to include permalink to image. 2058 * @return string 2059 */ 2060 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 2061 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' ); 2062 $id = (int) $id; 2063 $_post = & get_post($id); 2064 2065 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) 2066 return __('Missing Attachment'); 2067 2068 if ( $permalink ) 2069 $url = get_attachment_link($_post->ID); 2070 2071 $post_title = esc_attr($_post->post_title); 2072 2073 $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); 2074 return "<a href='$url' title='$post_title'>$innerHTML</a>"; 2075 } 2076 2077 /** 2078 * Retrieve icon URL and Path. 2079 * 2080 * @since 2.1.0 2081 * @deprecated 2.5.0 2082 * @deprecated Use wp_get_attachment_image_src() 2083 * @see wp_get_attachment_image_src() 2084 * 2085 * @param int $id Optional. Post ID. 2086 * @param bool $fullsize Optional, default to false. Whether to have full image. 2087 * @return array Icon URL and full path to file, respectively. 2088 */ 2089 function get_attachment_icon_src( $id = 0, $fullsize = false ) { 2090 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); 2091 $id = (int) $id; 2092 if ( !$post = & get_post($id) ) 2093 return false; 2094 2095 $file = get_attached_file( $post->ID ); 2096 2097 if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { 2098 // We have a thumbnail desired, specified and existing 2099 2100 $src_file = basename($src); 2101 $class = 'attachmentthumb'; 2102 } elseif ( wp_attachment_is_image( $post->ID ) ) { 2103 // We have an image without a thumbnail 2104 2105 $src = wp_get_attachment_url( $post->ID ); 2106 $src_file = & $file; 2107 $class = 'attachmentimage'; 2108 } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { 2109 // No thumb, no image. We'll look for a mime-related icon instead. 2110 2111 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); 2112 $src_file = $icon_dir . '/' . basename($src); 2113 } 2114 2115 if ( !isset($src) || !$src ) 2116 return false; 2117 2118 return array($src, $src_file); 2119 } 2120 2121 /** 2122 * Retrieve HTML content of icon attachment image element. 2123 * 2124 * @since 2.0.0 2125 * @deprecated 2.5.0 2126 * @deprecated Use wp_get_attachment_image() 2127 * @see wp_get_attachment_image() 2128 * 2129 * @param int $id Optional. Post ID. 2130 * @param bool $fullsize Optional, default to false. Whether to have full size image. 2131 * @param array $max_dims Optional. Dimensions of image. 2132 * @return string HTML content. 2133 */ 2134 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 2135 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 2136 $id = (int) $id; 2137 if ( !$post = & get_post($id) ) 2138 return false; 2139 2140 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) 2141 return false; 2142 2143 list($src, $src_file) = $src; 2144 2145 // Do we need to constrain the image? 2146 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { 2147 2148 $imagesize = getimagesize($src_file); 2149 2150 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { 2151 $actual_aspect = $imagesize[0] / $imagesize[1]; 2152 $desired_aspect = $max_dims[0] / $max_dims[1]; 2153 2154 if ( $actual_aspect >= $desired_aspect ) { 2155 $height = $actual_aspect * $max_dims[0]; 2156 $constraint = "width='{$max_dims[0]}' "; 2157 $post->iconsize = array($max_dims[0], $height); 2158 } else { 2159 $width = $max_dims[1] / $actual_aspect; 2160 $constraint = "height='{$max_dims[1]}' "; 2161 $post->iconsize = array($width, $max_dims[1]); 2162 } 2163 } else { 2164 $post->iconsize = array($imagesize[0], $imagesize[1]); 2165 $constraint = ''; 2166 } 2167 } else { 2168 $constraint = ''; 2169 } 2170 2171 $post_title = esc_attr($post->post_title); 2172 2173 $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>"; 2174 2175 return apply_filters( 'attachment_icon', $icon, $post->ID ); 2176 } 2177 2178 /** 2179 * Retrieve HTML content of image element. 2180 * 2181 * @since 2.0.0 2182 * @deprecated 2.5.0 2183 * @deprecated Use wp_get_attachment_image() 2184 * @see wp_get_attachment_image() 2185 * 2186 * @param int $id Optional. Post ID. 2187 * @param bool $fullsize Optional, default to false. Whether to have full size image. 2188 * @param array $max_dims Optional. Dimensions of image. 2189 * @return string 2190 */ 2191 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 2192 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 2193 $id = (int) $id; 2194 if ( !$post = & get_post($id) ) 2195 return false; 2196 2197 if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) 2198 return $innerHTML; 2199 2200 2201 $innerHTML = esc_attr($post->post_title); 2202 2203 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); 2204 } 2205 2206 /** 2207 * Performs esc_url() for database or redirect usage. 2208 * 2209 * @since 2.3.1 2210 * @deprecated 2.8.0 2211 * @deprecated Use esc_url_raw() 2212 * @see esc_url_raw() 2213 * @see esc_url() 2214 * 2215 * @param string $url The URL to be cleaned. 2216 * @param array $protocols An array of acceptable protocols. 2217 * @return string The cleaned URL. 2218 */ 2219 function sanitize_url( $url, $protocols = null ) { 2220 _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' ); 2221 return clean_url( $url, $protocols, 'db' ); 2222 } 2223 2224 /** 2225 * Escape single quotes, specialchar double quotes, and fix line endings. 2226 * 2227 * The filter 'js_escape' is also applied by esc_js() 2228 * 2229 * @since 2.0.4 2230 * @deprecated 2.8.0 2231 * @deprecated Use esc_js() 2232 * @see esc_js() 2233 * 2234 * @param string $text The text to be escaped. 2235 * @return string Escaped text. 2236 */ 2237 function js_escape( $text ) { 2238 _deprecated_function( __FUNCTION__, '2.8', 'esc_js()' ); 2239 return esc_js( $text ); 2240 } 2241 2242 /** 2243 * Escaping for HTML attributes. 2244 * 2245 * @since 2.0.6 2246 * @deprecated 2.8.0 2247 * @deprecated Use esc_attr() 2248 * @see esc_attr() 2249 * 2250 * @param string $text 2251 * @return string 2252 */ 2253 function attribute_escape( $text ) { 2254 _deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' ); 2255 return esc_attr( $text ); 2256 } 2257 2258 /** 2259 * Escaping for HTML blocks. 2260 * 2261 * Functionality of wp_specialchars() was transfered to _wp_specialchars() when 2262 * the esc_*() functions were introduced in 2.8.0. wp_specialchars() was maintained 2263 * for backwards compatability to call esc_html() or _wp_specialchars(). 2264 * 2265 * @since 1.2.2 2266 * @deprecated 2.8.0 2267 * @deprecated Use esc_html() 2268 * @see esc_html() 2269 * @see _wp_specialchars() 2270 */ 2271 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { 2272 _deprecated_function( __FUNCTION__, '2.8', 'esc_html()' ); 2273 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args 2274 $args = func_get_args(); 2275 return call_user_func_array( '_wp_specialchars', $args ); 2276 } else { 2277 return esc_html( $string ); 2278 } 2279 } 2280 ?> 2281 No newline at end of file -
wp-includes/pluggable.php
1634 1634 1635 1635 if ( !function_exists('wp_setcookie') ) : 1636 1636 /** 1637 * Sets a cookie for a user who just logged in. 1637 * Sets a cookie for a user who just logged in. This function is deprecated. 1638 1638 * 1639 1639 * @since 1.5 1640 * @deprecated 2.5 1640 1641 * @deprecated Use wp_set_auth_cookie() 1641 1642 * @see wp_set_auth_cookie() 1642 1643 * … … 1656 1657 1657 1658 if ( !function_exists('wp_clearcookie') ) : 1658 1659 /** 1659 * Clears the authentication cookie, logging the user out. 1660 * Clears the authentication cookie, logging the user out. This function is deprecated. 1660 1661 * 1661 1662 * @since 1.5 1663 * @deprecated 2.5 1662 1664 * @deprecated Use wp_clear_auth_cookie() 1663 1665 * @see wp_clear_auth_cookie() 1664 1666 */ … … 1670 1672 1671 1673 if ( !function_exists('wp_get_cookie_login') ): 1672 1674 /** 1673 * Gets the user cookie login. 1675 * Gets the user cookie login. This function is deprecated. 1674 1676 * 1675 1677 * This function is deprecated and should no longer be extended as it won't be 1676 1678 * used anywhere in WordPress. Also, plugins shouldn't use it either. 1677 1679 * 1678 1680 * @since 2.0.3 1681 * @deprecated 2.5 1679 1682 * @deprecated No alternative 1680 1683 * 1681 1684 * @return bool Always returns false 1682 1685 */ 1683 1686 function wp_get_cookie_login() { 1684 _deprecated_function( __FUNCTION__, '2.5' , '');1687 _deprecated_function( __FUNCTION__, '2.5' ); 1685 1688 return false; 1686 1689 } 1687 1690 endif; 1688 1691 1689 1692 if ( !function_exists('wp_login') ) : 1690 1693 /** 1691 * Checks a users login information and logs them in if it checks out. 1694 * Checks a users login information and logs them in if it checks out. This function is deprecated. 1692 1695 * 1693 1696 * Use the global $error to get the reason why the login failed. If the username 1694 1697 * is blank, no error will be set, so assume blank username on that case. … … 1707 1710 * @return bool False on login failure, true on successful check 1708 1711 */ 1709 1712 function wp_login($username, $password, $deprecated = '') { 1713 _deprecated_function( __FUNCTION__, '2.5', 'wp_signon()' ); 1710 1714 global $error; 1711 1715 1712 1716 $user = wp_authenticate($username, $password); -
wp-admin/includes/template.php
426 426 return $result; 427 427 } 428 428 429 //430 // Category Checklists431 //432 433 429 /** 434 430 * {@internal Missing Short Description}} 435 431 * 436 432 * @since unknown 437 * @deprecated Use {@link wp_link_category_checklist()}438 * @see wp_link_category_checklist()439 *440 * @param unknown_type $default441 * @param unknown_type $parent442 * @param unknown_type $popular_ids443 433 */ 444 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {445 global $post_ID;446 wp_category_checklist($post_ID);447 }448 449 /**450 * {@internal Missing Short Description}}451 *452 * @since unknown453 */454 434 class Walker_Category_Checklist extends Walker { 455 435 var $tree_type = 'category'; 456 436 var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this … … 580 560 * {@internal Missing Short Description}} 581 561 * 582 562 * @since unknown 583 * @deprecated Use {@link wp_link_category_checklist()}584 * @see wp_link_category_checklist()585 563 * 586 * @param unknown_type $default587 */588 function dropdown_link_categories( $default = 0 ) {589 global $link_id;590 591 wp_link_category_checklist($link_id);592 }593 594 /**595 * {@internal Missing Short Description}}596 *597 * @since unknown598 *599 564 * @param unknown_type $link_id 600 565 */ 601 566 function wp_link_category_checklist( $link_id = 0 ) { … … 2402 2367 * 2403 2368 * @since unknown 2404 2369 * 2405 * @param unknown_type $currentcat2406 * @param unknown_type $currentparent2407 * @param unknown_type $parent2408 * @param unknown_type $level2409 * @param unknown_type $categories2410 * @return unknown2411 */2412 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {2413 if (!$categories )2414 $categories = get_categories( array('hide_empty' => 0) );2415 2416 if ( $categories ) {2417 foreach ( $categories as $category ) {2418 if ( $currentcat != $category->term_id && $parent == $category->parent) {2419 $pad = str_repeat( '– ', $level );2420 $category->name = esc_html( $category->name );2421 echo "\n\t<option value='$category->term_id'";2422 if ( $currentparent == $category->term_id )2423 echo " selected='selected'";2424 echo ">$pad$category->name</option>";2425 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );2426 }2427 }2428 } else {2429 return false;2430 }2431 }2432 2433 /**2434 * {@internal Missing Short Description}}2435 *2436 * @since unknown2437 *2438 2370 * @param unknown_type $meta 2439 2371 */ 2440 2372 function list_meta( $meta ) {