WordPress.org

Make WordPress Core

Ticket #11388: 11388.2.diff

File 11388.2.diff, 36.3 KB (added by nacin, 8 years ago)

Second patch includes four pre-2.8 escape functions. These were already marked as deprecated in phpdoc.

  • wp-admin/includes/template.php

     
    426426        return $result;
    427427}
    428428
    429 //
    430 // Category Checklists
    431 //
    432 
    433429/**
    434430 * {@internal Missing Short Description}}
    435431 *
    436432 * @since unknown
    437  * @deprecated Use {@link wp_link_category_checklist()}
    438  * @see wp_link_category_checklist()
    439  *
    440  * @param unknown_type $default
    441  * @param unknown_type $parent
    442  * @param unknown_type $popular_ids
    443433 */
    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 unknown
    453  */
    454434class Walker_Category_Checklist extends Walker {
    455435        var $tree_type = 'category';
    456436        var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this
     
    23942374 *
    23952375 * @since unknown
    23962376 *
    2397  * @param unknown_type $currentcat
    2398  * @param unknown_type $currentparent
    2399  * @param unknown_type $parent
    2400  * @param unknown_type $level
    2401  * @param unknown_type $categories
    2402  * @return unknown
    2403  */
    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 unknown
    2429  *
    24302377 * @param unknown_type $meta
    24312378 */
    24322379function list_meta( $meta ) {
  • wp-includes/bookmark.php

     
    8080}
    8181
    8282/**
    83  * Retrieve bookmark data based on ID.
    84  *
    85  * @since 2.0.0
    86  * @deprecated Use get_bookmark()
    87  * @see get_bookmark()
    88  *
    89  * @param int $bookmark_id ID of link
    90  * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A
    91  * @return object|array
    92  */
    93 function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
    94         return get_bookmark($bookmark_id, $output, $filter);
    95 }
    96 
    97 /**
    9883 * Retrieves the list of bookmarks
    9984 *
    10085 * Attempts to retrieve from the cache first based on MD5 hash of arguments. If
  • wp-includes/deprecated.php

     
    125125function start_wp() {
    126126        global $wp_query, $post;
    127127
    128         _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop')  );
     128        _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') );
    129129
    130130        // Since the old style loop is being used, advance the query iterator here.
    131131        $wp_query->next_post();
     
    487487 * Gets the links associated with the named category.
    488488 *
    489489 * @since 1.0.1
     490 * @deprecated 2.1
    490491 * @deprecated Use wp_list_bookmarks()
    491492 * @see wp_list_bookmarks()
    492493 *
     
    495496 * @return bool|null
    496497 */
    497498function wp_get_linksbyname($category, $args = '') {
    498         _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
     499        _deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');
    499500
    500501        $defaults = array(
    501502                'after' => '<br />',
     
    661662 * Gets the auto_toggle setting.
    662663 *
    663664 * @since 0.71
     665 * @deprecated 2.1
    664666 * @deprecated No alternative function available
    665667 *
    666668 * @param int $id The category to get. If no category supplied uses 0
    667669 * @return int Only returns 0.
    668670 */
    669671function get_autotoggle($id = 0) {
    670         _deprecated_function( __FUNCTION__, '2.1'  );
     672        _deprecated_function( __FUNCTION__, '2.1' );
    671673        return 0;
    672674}
    673675
     
    741743
    742744/**
    743745 * @since 0.71
     746 * @deprecated 2.1
    744747 * @deprecated Use wp_dropdown_categories()
    745748 * @see wp_dropdown_categories()
    746749 *
     
    776779}
    777780
    778781/**
     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 */
     793function 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 */
     809function 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 */
     830function 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( '&#8211; ', $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/**
    779853 * @since 2.1
    780854 * @deprecated 2.1
    781855 * @deprecated Use wp_tiny_mce().
     
    9431017 * Print the permalink to the RSS feed.
    9441018 *
    9451019 * @since 0.71
     1020 * @deprecated 2.3
    9461021 * @deprecated Use the_permalink_rss()
    9471022 * @see the_permalink_rss()
    9481023 *
    9491024 * @param string $file
    9501025 */
    9511026function permalink_single_rss($deprecated = '') {
    952         _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()');
     1027        _deprecated_function(__FUNCTION__, '2.3', 'the_permalink_rss()');
    9531028        the_permalink_rss();
    9541029}
    9551030
    9561031/**
     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 */
     1043function 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/**
    9571049 * Gets the links associated with category.
    9581050 *
    959  * @see get_links() for argument information that can be used in $args
    9601051 * @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()
    9631055 *
    9641056 * @param string $args a query string
    9651057 * @return null|string
    9661058 */
    9671059function wp_get_links($args = '') {
    968         _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
     1060        _deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()' );
    9691061
    9701062        if ( strpos( $args, '=' ) === false ) {
    9711063                $cat_id = $args;
     
    9971089 * Gets the links associated with category by id.
    9981090 *
    9991091 * @since 0.71
     1092 * @deprecated 2.1
    10001093 * @deprecated Use get_bookmarks()
    10011094 * @see get_bookmarks()
    10021095 *
     
    11621255 * @param bool $count the number of links in the db
    11631256 */
    11641257function 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' );
    11661259
    11671260        if ( $count )
    11681261                $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links");
     
    13201413 *
    13211414 */
    13221415function documentation_link() {
    1323         _deprecated_function( __FUNCTION__, '2.5', '' );
     1416        _deprecated_function( __FUNCTION__, '2.5' );
    13241417        return;
    13251418}
    13261419
    13271420/**
    13281421 * Unused function.
    13291422 *
     1423 * @since unknown
    13301424 * @deprecated 2.5
    13311425*/
    13321426function gzip_compression() {
    1333         _deprecated_function( __FUNCTION__, '2.5', '' );
     1427        _deprecated_function( __FUNCTION__, '2.5' );
    13341428        return false;
    13351429}
    13361430
     
    14171511 * @return string The author's description.
    14181512 */
    14191513function 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\')' );
    14211515        return get_the_author_meta('description');
    14221516}
    14231517
     
    14301524 * @see the_author_meta()
    14311525 */
    14321526function the_author_description() {
    1433         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')'  );
     1527        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' );
    14341528        the_author_meta('description');
    14351529}
    14361530
     
    14451539 * @return string The author's login name (username).
    14461540 */
    14471541function 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\')' );
    14491543        return get_the_author_meta('login');
    14501544}
    14511545
     
    14581552 * @see the_author_meta()
    14591553 */
    14601554function the_author_login() {
    1461         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')'  );
     1555        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' );
    14621556        the_author_meta('login');
    14631557}
    14641558
     
    14731567 * @return string The author's first name.
    14741568 */
    14751569function 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\')' );
    14771571        return get_the_author_meta('first_name');
    14781572}
    14791573
     
    14861580 * @see the_author_meta()
    14871581 */
    14881582function 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\')' );
    14901584        the_author_meta('first_name');
    14911585}
    14921586
     
    15011595 * @return string The author's last name.
    15021596 */
    15031597function 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\')' );
    15051599        return get_the_author_meta('last_name');
    15061600}
    15071601
     
    15141608 * @see the_author_meta()
    15151609 */
    15161610function 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\')' );
    15181612        the_author_meta('last_name');
    15191613}
    15201614
     
    15291623 * @return string The author's nickname.
    15301624 */
    15311625function 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\')' );
    15331627        return get_the_author_meta('nickname');
    15341628}
    15351629
     
    15421636 * @see the_author_meta()
    15431637 */
    15441638function the_author_nickname() {
    1545         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')'  );
     1639        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' );
    15461640        the_author_meta('nickname');
    15471641}
    15481642
     
    15571651 * @return string The author's username.
    15581652 */
    15591653function 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\')' );
    15611655        return get_the_author_meta('email');
    15621656}
    15631657
     
    15701664 * @see the_author_meta()
    15711665 */
    15721666function the_author_email() {
    1573         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')'  );
     1667        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' );
    15741668        the_author_meta('email');
    15751669}
    15761670
     
    15851679 * @return string The author's ICQ number.
    15861680 */
    15871681function 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\')' );
    15891683        return get_the_author_meta('icq');
    15901684}
    15911685
     
    15981692 * @see the_author_meta()
    15991693 */
    16001694function the_author_icq() {
    1601         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')'  );
     1695        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' );
    16021696        the_author_meta('icq');
    16031697}
    16041698
     
    16131707 * @return string The author's Yahoo! IM name.
    16141708 */
    16151709function 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\')' );
    16171711        return get_the_author_meta('yim');
    16181712}
    16191713
     
    16261720 * @see the_author_meta()
    16271721 */
    16281722function the_author_yim() {
    1629         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')'  );
     1723        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' );
    16301724        the_author_meta('yim');
    16311725}
    16321726
     
    16411735 * @return string The author's MSN address.
    16421736 */
    16431737function 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\')' );
    16451739        return get_the_author_meta('msn');
    16461740}
    16471741
     
    16541748 * @see the_author_meta()
    16551749 */
    16561750function the_author_msn() {
    1657         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')'  );
     1751        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' );
    16581752        the_author_meta('msn');
    16591753}
    16601754
     
    16691763 * @return string The author's AIM address.
    16701764 */
    16711765function 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\')' );
    16731767        return get_the_author_meta('aim');
    16741768}
    16751769
     
    16821776 * @deprecated Use the_author_meta('aim')
    16831777 */
    16841778function the_author_aim() {
    1685         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')'  );
     1779        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' );
    16861780        the_author_meta('aim');
    16871781}
    16881782
     
    16981792 * @return string The author's display name.
    16991793 */
    17001794function 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\')' );
    17021796        return get_the_author_meta('display_name', $auth_id);
    17031797}
    17041798
     
    17131807 * @return string The URL to the author's page.
    17141808 */
    17151809function 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\')' );
    17171811        return get_the_author_meta('url');
    17181812}
    17191813
     
    17261820 * @see the_author_meta()
    17271821 */
    17281822function the_author_url() {
    1729         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')'  );
     1823        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' );
    17301824        the_author_meta('url');
    17311825}
    17321826
     
    17411835 * @return int The author's ID.
    17421836 */
    17431837function 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\')' );
    17451839        return get_the_author_meta('ID');
    17461840}
    17471841
     
    17541848 * @see the_author_meta()
    17551849*/
    17561850function the_author_ID() {
    1757         _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')'  );
     1851        _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' );
    17581852        the_author_meta('ID');
    17591853}
    17601854
     
    17931887 * @param int $encode_html Optional. How to encode the content.
    17941888 */
    17951889function 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()' );
    17971891        $content = get_the_content($more_link_text, $stripteaser, $more_file);
    17981892        $content = apply_filters('the_content_rss', $content);
    17991893        if ( $cut && !$encode_html )
     
    18391933 * @return string HTML stripped out of content with links at the bottom.
    18401934 */
    18411935function make_url_footnote( $content ) {
    1842         _deprecated_function( __FUNCTION__, '2.9', '' );
     1936        _deprecated_function( __FUNCTION__, '2.9' );
    18431937        preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
    18441938        $links_summary = "\n";
    18451939        for ( $i=0; $i<count($matches[0]); $i++ ) {
     
    18571951}
    18581952
    18591953/**
     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 */
     1961function __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 */
     1975function __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/**
    18601983 * Retrieve translated string with vertical bar context
    18611984 *
    18621985 * Quite a few times, there will be collisions with similar translatable text
     
    18792002 * @return string Translated context string without pipe
    18802003 */
    18812004function _c( $text, $domain = 'default' ) {
    1882         _deprecated_function(__FUNCTION__, '2.9', '_x' );
     2005        _deprecated_function(__FUNCTION__, '2.9', '_x()' );
    18832006        return translate_with_context( $text, $domain );
    18842007}
    18852008
     
    18962019 *
    18972020 */
    18982021function _nc( $single, $plural, $number, $domain = 'default' ) {
    1899         _deprecated_function(__FUNCTION__, '2.9', '_nx' );
     2022        _deprecated_function(__FUNCTION__, '3.0', '_nx()' );
    19002023        return before_last_bar( _n( $single, $plural, $number, $domain ) );
    19012024}
    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 */
     2040function 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 */
     2069function 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 */
     2114function 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 */
     2171function 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 */
     2199function 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 */
     2217function 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 */
     2233function 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 */
     2251function 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

     
    22622262}
    22632263
    22642264/**
    2265  * Performs esc_url() for database or redirect usage.
    2266  *
    2267  * @see esc_url()
    2268  * @deprecated 2.8.0
    2269  *
    2270  * @since 2.3.1
    2271  *
    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 /**
    22812265 * Convert entities, while preserving already-encoded entities.
    22822266 *
    22832267 * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes.
     
    23152299}
    23162300
    23172301/**
    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.4
    2323  *
    2324  * @deprecated 2.8.0
    2325  * @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 /**
    23352302 * Escaping for HTML blocks.
    23362303 *
    23372304 * @since 2.8.0
     
    23462313}
    23472314
    23482315/**
    2349  * Escaping for HTML blocks
    2350  * @deprecated 2.8.0
    2351  * @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 args
    2355                 $args = func_get_args();
    2356                 return call_user_func_array( '_wp_specialchars', $args );
    2357         } else {
    2358                 return esc_html( $string );
    2359         }
    2360 }
    2361 
    2362 /**
    23632316 * Escaping for HTML attributes.
    23642317 *
    23652318 * @since 2.8.0
     
    23742327}
    23752328
    23762329/**
    2377  * Escaping for HTML attributes.
    2378  *
    2379  * @since 2.0.6
    2380  *
    2381  * @deprecated 2.8.0
    2382  * @see esc_attr()
    2383  *
    2384  * @param string $text
    2385  * @return string
    2386  */
    2387 function attribute_escape( $text ) {
    2388         return esc_attr( $text );
    2389 }
    2390 
    2391 /**
    23922330 * Escape a HTML tag name.
    23932331 *
    23942332 * @since 2.5.0
  • wp-includes/l10n.php

     
    204204        return esc_html( translate_with_gettext_context( $single, $context, $domain ) );
    205205}
    206206
    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 
    213207/**
    214208 * Retrieve the plural or single form based on the amount.
    215209 *
     
    221215 * to the 'ngettext' filter hook along with the same parameters. The expected
    222216 * type will be a string.
    223217 *
    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
    225221 * @uses $l10n Gets list of domain translated string (gettext_reader) objects
    226222 * @uses apply_filters() Calls 'ngettext' hook on domains text returned,
    227223 *              along with $single, $plural, and $number parameters. Expected to return string.
     
    252248}
    253249
    254250/**
    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 /**
    265251 * Register plural strings in POT file, but don't translate them.
    266252 *
    267253 * Used when you want do keep structures with translatable plural strings and
     
    276262 *  $message = $messages[$type];
    277263 *  $usable_text = sprintf(_n($message[0], $message[1], $count), $count);
    278264 *
    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
    280268 * @param $single Single form to be i18ned
    281269 * @param $plural Plural form to be i18ned
    282270 * @return array array($single, $plural)
  • wp-includes/pluggable.php

     
    16341634
    16351635if ( !function_exists('wp_setcookie') ) :
    16361636/**
    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.
    16381638 *
    16391639 * @since 1.5
     1640 * @deprecated 2.5
    16401641 * @deprecated Use wp_set_auth_cookie()
    16411642 * @see wp_set_auth_cookie()
    16421643 *
     
    16561657
    16571658if ( !function_exists('wp_clearcookie') ) :
    16581659/**
    1659  * Clears the authentication cookie, logging the user out.
     1660 * Clears the authentication cookie, logging the user out. This function is deprecated.
    16601661 *
    16611662 * @since 1.5
     1663 * @deprecated 2.5
    16621664 * @deprecated Use wp_clear_auth_cookie()
    16631665 * @see wp_clear_auth_cookie()
    16641666 */
     
    16701672
    16711673if ( !function_exists('wp_get_cookie_login') ):
    16721674/**
    1673  * Gets the user cookie login.
     1675 * Gets the user cookie login. This function is deprecated.
    16741676 *
    16751677 * This function is deprecated and should no longer be extended as it won't be
    16761678 * used anywhere in WordPress. Also, plugins shouldn't use it either.
    16771679 *
    16781680 * @since 2.0.3
     1681 * @deprecated 2.5
    16791682 * @deprecated No alternative
    16801683 *
    16811684 * @return bool Always returns false
    16821685 */
    16831686function wp_get_cookie_login() {
    1684         _deprecated_function( __FUNCTION__, '2.5', '' );
     1687        _deprecated_function( __FUNCTION__, '2.5' );
    16851688        return false;
    16861689}
    16871690endif;
    16881691
    16891692if ( !function_exists('wp_login') ) :
    16901693/**
    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.
    16921695 *
    16931696 * Use the global $error to get the reason why the login failed. If the username
    16941697 * is blank, no error will be set, so assume blank username on that case.
     
    17071710 * @return bool False on login failure, true on successful check
    17081711 */
    17091712function wp_login($username, $password, $deprecated = '') {
     1713        _deprecated_function( __FUNCTION__, '2.5', 'wp_signon()' );
    17101714        global $error;
    17111715
    17121716        $user = wp_authenticate($username, $password);
  • wp-includes/post-template.php

     
    945945}
    946946
    947947/**
    948  * Retrieve HTML content of attachment image with link.
    949  *
    950  * @since 2.0.0
    951  * @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 string
    959  */
    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.0
    980  * @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 existing
    996 
    997                 $src_file = basename($src);
    998                 $class = 'attachmentthumb';
    999         } elseif ( wp_attachment_is_image( $post->ID ) ) {
    1000                 // We have an image without a thumbnail
    1001 
    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.0
    1022  * @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.0
    1077  * @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 string
    1084  */
    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 /**
    1100948 * Wrap attachment in <<p>> element before content.
    1101949 *
    1102950 * @since 2.0.0