Ticket #11388: 11388.2.diff
File 11388.2.diff, 36.3 KB (added by , 15 years ago) |
---|
-
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 … … 2394 2374 * 2395 2375 * @since unknown 2396 2376 * 2397 * @param unknown_type $currentcat2398 * @param unknown_type $currentparent2399 * @param unknown_type $parent2400 * @param unknown_type $level2401 * @param unknown_type $categories2402 * @return unknown2403 */2404 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {2405 if (!$categories )2406 $categories = get_categories( array('hide_empty' => 0) );2407 2408 if ( $categories ) {2409 foreach ( $categories as $category ) {2410 if ( $currentcat != $category->term_id && $parent == $category->parent) {2411 $pad = str_repeat( '– ', $level );2412 $category->name = esc_html( $category->name );2413 echo "\n\t<option value='$category->term_id'";2414 if ( $currentparent == $category->term_id )2415 echo " selected='selected'";2416 echo ">$pad$category->name</option>";2417 wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );2418 }2419 }2420 } else {2421 return false;2422 }2423 }2424 2425 /**2426 * {@internal Missing Short Description}}2427 *2428 * @since unknown2429 *2430 2377 * @param unknown_type $meta 2431 2378 */ 2432 2379 function list_meta( $meta ) { -
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/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 ' );2005 _deprecated_function(__FUNCTION__, '2.9', '_x()' ); 1883 2006 return translate_with_context( $text, $domain ); 1884 2007 } 1885 2008 … … 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 * Retrieve HTML content of attachment image with link. 2028 * 2029 * @since 2.0.0 2030 * @deprecated 2.5.0 2031 * @deprecated Use wp_get_attachment_link() 2032 * @see wp_get_attachment_link() 2033 * 2034 * @param int $id Optional. Post ID. 2035 * @param bool $fullsize Optional, default is false. Whether to use full size image. 2036 * @param array $max_dims Optional. Max image dimensions. 2037 * @param bool $permalink Optional, default is false. Whether to include permalink to image. 2038 * @return string 2039 */ 2040 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 2041 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' ); 2042 $id = (int) $id; 2043 $_post = & get_post($id); 2044 2045 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) 2046 return __('Missing Attachment'); 2047 2048 if ( $permalink ) 2049 $url = get_attachment_link($_post->ID); 2050 2051 $post_title = esc_attr($_post->post_title); 2052 2053 $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); 2054 return "<a href='$url' title='$post_title'>$innerHTML</a>"; 2055 } 2056 2057 /** 2058 * Retrieve icon URL and Path. 2059 * 2060 * @since 2.1.0 2061 * @deprecated 2.5.0 2062 * @deprecated Use wp_get_attachment_image_src() 2063 * @see wp_get_attachment_image_src() 2064 * 2065 * @param int $id Optional. Post ID. 2066 * @param bool $fullsize Optional, default to false. Whether to have full image. 2067 * @return array Icon URL and full path to file, respectively. 2068 */ 2069 function get_attachment_icon_src( $id = 0, $fullsize = false ) { 2070 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); 2071 $id = (int) $id; 2072 if ( !$post = & get_post($id) ) 2073 return false; 2074 2075 $file = get_attached_file( $post->ID ); 2076 2077 if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { 2078 // We have a thumbnail desired, specified and existing 2079 2080 $src_file = basename($src); 2081 $class = 'attachmentthumb'; 2082 } elseif ( wp_attachment_is_image( $post->ID ) ) { 2083 // We have an image without a thumbnail 2084 2085 $src = wp_get_attachment_url( $post->ID ); 2086 $src_file = & $file; 2087 $class = 'attachmentimage'; 2088 } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { 2089 // No thumb, no image. We'll look for a mime-related icon instead. 2090 2091 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); 2092 $src_file = $icon_dir . '/' . basename($src); 2093 } 2094 2095 if ( !isset($src) || !$src ) 2096 return false; 2097 2098 return array($src, $src_file); 2099 } 2100 2101 /** 2102 * Retrieve HTML content of icon attachment image element. 2103 * 2104 * @since 2.0.0 2105 * @deprecated 2.5.0 2106 * @deprecated Use wp_get_attachment_image() 2107 * @see wp_get_attachment_image() 2108 * 2109 * @param int $id Optional. Post ID. 2110 * @param bool $fullsize Optional, default to false. Whether to have full size image. 2111 * @param array $max_dims Optional. Dimensions of image. 2112 * @return string HTML content. 2113 */ 2114 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 2115 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 2116 $id = (int) $id; 2117 if ( !$post = & get_post($id) ) 2118 return false; 2119 2120 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) 2121 return false; 2122 2123 list($src, $src_file) = $src; 2124 2125 // Do we need to constrain the image? 2126 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { 2127 2128 $imagesize = getimagesize($src_file); 2129 2130 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { 2131 $actual_aspect = $imagesize[0] / $imagesize[1]; 2132 $desired_aspect = $max_dims[0] / $max_dims[1]; 2133 2134 if ( $actual_aspect >= $desired_aspect ) { 2135 $height = $actual_aspect * $max_dims[0]; 2136 $constraint = "width='{$max_dims[0]}' "; 2137 $post->iconsize = array($max_dims[0], $height); 2138 } else { 2139 $width = $max_dims[1] / $actual_aspect; 2140 $constraint = "height='{$max_dims[1]}' "; 2141 $post->iconsize = array($width, $max_dims[1]); 2142 } 2143 } else { 2144 $post->iconsize = array($imagesize[0], $imagesize[1]); 2145 $constraint = ''; 2146 } 2147 } else { 2148 $constraint = ''; 2149 } 2150 2151 $post_title = esc_attr($post->post_title); 2152 2153 $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>"; 2154 2155 return apply_filters( 'attachment_icon', $icon, $post->ID ); 2156 } 2157 2158 /** 2159 * Retrieve HTML content of image element. 2160 * 2161 * @since 2.0.0 2162 * @deprecated 2.5.0 2163 * @deprecated Use wp_get_attachment_image() 2164 * @see wp_get_attachment_image() 2165 * 2166 * @param int $id Optional. Post ID. 2167 * @param bool $fullsize Optional, default to false. Whether to have full size image. 2168 * @param array $max_dims Optional. Dimensions of image. 2169 * @return string 2170 */ 2171 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 2172 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 2173 $id = (int) $id; 2174 if ( !$post = & get_post($id) ) 2175 return false; 2176 2177 if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) 2178 return $innerHTML; 2179 2180 2181 $innerHTML = esc_attr($post->post_title); 2182 2183 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); 2184 } 2185 2186 /** 2187 * Performs esc_url() for database or redirect usage. 2188 * 2189 * @since 2.3.1 2190 * @deprecated 2.8.0 2191 * @deprecated Use esc_url_raw() 2192 * @see esc_url_raw() 2193 * @see esc_url() 2194 * 2195 * @param string $url The URL to be cleaned. 2196 * @param array $protocols An array of acceptable protocols. 2197 * @return string The cleaned URL. 2198 */ 2199 function sanitize_url( $url, $protocols = null ) { 2200 _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' ); 2201 return clean_url( $url, $protocols, 'db' ); 2202 } 2203 2204 /** 2205 * Escape single quotes, specialchar double quotes, and fix line endings. 2206 * 2207 * The filter 'js_escape' is also applied by esc_js() 2208 * 2209 * @since 2.0.4 2210 * @deprecated 2.8.0 2211 * @deprecated Use esc_js() 2212 * @see esc_js() 2213 * 2214 * @param string $text The text to be escaped. 2215 * @return string Escaped text. 2216 */ 2217 function js_escape( $text ) { 2218 _deprecated_function( __FUNCTION__, '2.8', 'esc_js()' ); 2219 return esc_js( $text ); 2220 } 2221 2222 /** 2223 * Escaping for HTML attributes. 2224 * 2225 * @since 2.0.6 2226 * @deprecated 2.8.0 2227 * @deprecated Use esc_attr() 2228 * @see esc_attr() 2229 * 2230 * @param string $text 2231 * @return string 2232 */ 2233 function attribute_escape( $text ) { 2234 _deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' ); 2235 return esc_attr( $text ); 2236 } 2237 2238 /** 2239 * Escaping for HTML blocks. 2240 * 2241 * Functionality of wp_specialchars() was transfered to _wp_specialchars() when 2242 * the esc_*() functions were introduced in 2.8.0. wp_specialchars() was maintained 2243 * for backwards compatability to call esc_html() or _wp_specialchars(). 2244 * 2245 * @since 1.2.2 2246 * @deprecated 2.8.0 2247 * @deprecated Use esc_html() 2248 * @see esc_html() 2249 * @see _wp_specialchars() 2250 */ 2251 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { 2252 _deprecated_function( __FUNCTION__, '2.8', 'esc_html()' ); 2253 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args 2254 $args = func_get_args(); 2255 return call_user_func_array( '_wp_specialchars', $args ); 2256 } else { 2257 return esc_html( $string ); 2258 } 2259 } 2260 ?> 2261 No newline at end of file -
wp-includes/formatting.php
2262 2262 } 2263 2263 2264 2264 /** 2265 * Performs esc_url() for database or redirect usage.2266 *2267 * @see esc_url()2268 * @deprecated 2.8.02269 *2270 * @since 2.3.12271 *2272 * @param string $url The URL to be cleaned.2273 * @param array $protocols An array of acceptable protocols.2274 * @return string The cleaned URL.2275 */2276 function sanitize_url( $url, $protocols = null ) {2277 return clean_url( $url, $protocols, 'db' );2278 }2279 2280 /**2281 2265 * Convert entities, while preserving already-encoded entities. 2282 2266 * 2283 2267 * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes. … … 2315 2299 } 2316 2300 2317 2301 /** 2318 * Escape single quotes, specialchar double quotes, and fix line endings.2319 *2320 * The filter 'js_escape' is also applied by esc_js()2321 *2322 * @since 2.0.42323 *2324 * @deprecated 2.8.02325 * @see esc_js()2326 *2327 * @param string $text The text to be escaped.2328 * @return string Escaped text.2329 */2330 function js_escape( $text ) {2331 return esc_js( $text );2332 }2333 2334 /**2335 2302 * Escaping for HTML blocks. 2336 2303 * 2337 2304 * @since 2.8.0 … … 2346 2313 } 2347 2314 2348 2315 /** 2349 * Escaping for HTML blocks2350 * @deprecated 2.8.02351 * @see esc_html()2352 */2353 function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {2354 if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args2355 $args = func_get_args();2356 return call_user_func_array( '_wp_specialchars', $args );2357 } else {2358 return esc_html( $string );2359 }2360 }2361 2362 /**2363 2316 * Escaping for HTML attributes. 2364 2317 * 2365 2318 * @since 2.8.0 … … 2374 2327 } 2375 2328 2376 2329 /** 2377 * Escaping for HTML attributes.2378 *2379 * @since 2.0.62380 *2381 * @deprecated 2.8.02382 * @see esc_attr()2383 *2384 * @param string $text2385 * @return string2386 */2387 function attribute_escape( $text ) {2388 return esc_attr( $text );2389 }2390 2391 /**2392 2330 * Escape a HTML tag name. 2393 2331 * 2394 2332 * @since 2.5.0 -
wp-includes/l10n.php
204 204 return esc_html( translate_with_gettext_context( $single, $context, $domain ) ); 205 205 } 206 206 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 207 /** 214 208 * Retrieve the plural or single form based on the amount. 215 209 * … … 221 215 * to the 'ngettext' filter hook along with the same parameters. The expected 222 216 * type will be a string. 223 217 * 224 * @since 1.2.0 218 * Formerly __ngettext(), which was deprecated in 2.8.0 in favor of _n(). 219 * 220 * @since 2.8.0 225 221 * @uses $l10n Gets list of domain translated string (gettext_reader) objects 226 222 * @uses apply_filters() Calls 'ngettext' hook on domains text returned, 227 223 * along with $single, $plural, and $number parameters. Expected to return string. … … 252 248 } 253 249 254 250 /** 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 251 * Register plural strings in POT file, but don't translate them. 266 252 * 267 253 * Used when you want do keep structures with translatable plural strings and … … 276 262 * $message = $messages[$type]; 277 263 * $usable_text = sprintf(_n($message[0], $message[1], $count), $count); 278 264 * 279 * @since 2.5 265 * Formerly __ngettext_noop(), which was deprecated in 2.8.0 in favor of _n_noop(). 266 * 267 * @since 2.8.0 280 268 * @param $single Single form to be i18ned 281 269 * @param $plural Plural form to be i18ned 282 270 * @return array array($single, $plural) -
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-includes/post-template.php
945 945 } 946 946 947 947 /** 948 * Retrieve HTML content of attachment image with link.949 *950 * @since 2.0.0951 * @deprecated Use {@link wp_get_attachment_link()}952 * @see wp_get_attachment_link() Use instead.953 *954 * @param int $id Optional. Post ID.955 * @param bool $fullsize Optional, default is false. Whether to use full size image.956 * @param array $max_dims Optional. Max image dimensions.957 * @param bool $permalink Optional, default is false. Whether to include permalink to image.958 * @return string959 */960 function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {961 $id = (int) $id;962 $_post = & get_post($id);963 964 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )965 return __('Missing Attachment');966 967 if ( $permalink )968 $url = get_attachment_link($_post->ID);969 970 $post_title = esc_attr($_post->post_title);971 972 $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims);973 return "<a href='$url' title='$post_title'>$innerHTML</a>";974 }975 976 /**977 * Retrieve icon URL and Path.978 *979 * @since 2.1.0980 * @deprecated Use {@link wp_get_attachment_image_src()}981 * @see wp_get_attachment_image_src() Use instead.982 *983 * @param int $id Optional. Post ID.984 * @param bool $fullsize Optional, default to false. Whether to have full image.985 * @return array Icon URL and full path to file, respectively.986 */987 function get_attachment_icon_src( $id = 0, $fullsize = false ) {988 $id = (int) $id;989 if ( !$post = & get_post($id) )990 return false;991 992 $file = get_attached_file( $post->ID );993 994 if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {995 // We have a thumbnail desired, specified and existing996 997 $src_file = basename($src);998 $class = 'attachmentthumb';999 } elseif ( wp_attachment_is_image( $post->ID ) ) {1000 // We have an image without a thumbnail1001 1002 $src = wp_get_attachment_url( $post->ID );1003 $src_file = & $file;1004 $class = 'attachmentimage';1005 } elseif ( $src = wp_mime_type_icon( $post->ID ) ) {1006 // No thumb, no image. We'll look for a mime-related icon instead.1007 1008 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );1009 $src_file = $icon_dir . '/' . basename($src);1010 }1011 1012 if ( !isset($src) || !$src )1013 return false;1014 1015 return array($src, $src_file);1016 }1017 1018 /**1019 * Retrieve HTML content of icon attachment image element.1020 *1021 * @since 2.0.01022 * @deprecated Use {@link wp_get_attachment_image()}1023 * @see wp_get_attachment_image() Use instead of.1024 *1025 * @param int $id Optional. Post ID.1026 * @param bool $fullsize Optional, default to false. Whether to have full size image.1027 * @param array $max_dims Optional. Dimensions of image.1028 * @return string HTML content.1029 */1030 function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {1031 $id = (int) $id;1032 if ( !$post = & get_post($id) )1033 return false;1034 1035 if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) )1036 return false;1037 1038 list($src, $src_file) = $src;1039 1040 // Do we need to constrain the image?1041 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {1042 1043 $imagesize = getimagesize($src_file);1044 1045 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {1046 $actual_aspect = $imagesize[0] / $imagesize[1];1047 $desired_aspect = $max_dims[0] / $max_dims[1];1048 1049 if ( $actual_aspect >= $desired_aspect ) {1050 $height = $actual_aspect * $max_dims[0];1051 $constraint = "width='{$max_dims[0]}' ";1052 $post->iconsize = array($max_dims[0], $height);1053 } else {1054 $width = $max_dims[1] / $actual_aspect;1055 $constraint = "height='{$max_dims[1]}' ";1056 $post->iconsize = array($width, $max_dims[1]);1057 }1058 } else {1059 $post->iconsize = array($imagesize[0], $imagesize[1]);1060 $constraint = '';1061 }1062 } else {1063 $constraint = '';1064 }1065 1066 $post_title = esc_attr($post->post_title);1067 1068 $icon = "<img src='$src' title='$post_title' alt='$post_title' $constraint/>";1069 1070 return apply_filters( 'attachment_icon', $icon, $post->ID );1071 }1072 1073 /**1074 * Retrieve HTML content of image element.1075 *1076 * @since 2.0.01077 * @deprecated Use {@link wp_get_attachment_image()}1078 * @see wp_get_attachment_image() Use instead.1079 *1080 * @param int $id Optional. Post ID.1081 * @param bool $fullsize Optional, default to false. Whether to have full size image.1082 * @param array $max_dims Optional. Dimensions of image.1083 * @return string1084 */1085 function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {1086 $id = (int) $id;1087 if ( !$post = & get_post($id) )1088 return false;1089 1090 if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims))1091 return $innerHTML;1092 1093 1094 $innerHTML = esc_attr($post->post_title);1095 1096 return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);1097 }1098 1099 /**1100 948 * Wrap attachment in <<p>> element before content. 1101 949 * 1102 950 * @since 2.0.0