WordPress.org

Make WordPress Core

Ticket #11388: 11388.4.diff

File 11388.4.diff, 37.9 KB (added by nacin, 8 years ago)

Deprecates translate_with_context() in favor of _x(). Commiting dev may wish to change reference to _x() to translate_with_gettext_context().

  • wp-includes/post-template.php

     
    949949}
    950950
    951951/**
    952  * Retrieve HTML content of attachment image with link.
    953  *
    954  * @since 2.0.0
    955  * @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 string
    963  */
    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.0
    984  * @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 existing
    1000 
    1001                 $src_file = basename($src);
    1002                 $class = 'attachmentthumb';
    1003         } elseif ( wp_attachment_is_image( $post->ID ) ) {
    1004                 // We have an image without a thumbnail
    1005 
    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.0
    1026  * @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.0
    1081  * @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 string
    1088  */
    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 /**
    1104952 * Wrap attachment in <<p>> element before content.
    1105953 *
    1106954 * @since 2.0.0
  • wp-includes/l10n.php

     
    6767                return substr( $string, 0, $last_bar );
    6868}
    6969
    70 /**
    71  * Translates $text like translate(), but assumes that the text
    72  * contains a context after its last vertical bar.
    73  *
    74  * @since 2.5
    75  * @uses translate()
    76  *
    77  * @param string $text Text to translate
    78  * @param string $domain Domain to retrieve the translated text
    79  * @return string Translated text
    80  */
    81 function translate_with_context( $text, $domain = 'default' ) {
    82         return before_last_bar( translate( $text, $domain ) );
    83 }
    84 
    8570function translate_with_gettext_context( $text, $context, $domain = 'default' ) {
    8671        $translations = &get_translations_for_domain( $domain );
    8772        return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain );
     
    204189        return esc_html( translate_with_gettext_context( $single, $context, $domain ) );
    205190}
    206191
    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 
    213192/**
    214193 * Retrieve the plural or single form based on the amount.
    215194 *
     
    221200 * to the 'ngettext' filter hook along with the same parameters. The expected
    222201 * type will be a string.
    223202 *
    224  * @since 1.2.0
     203 * @since 2.8.0
    225204 * @uses $l10n Gets list of domain translated string (gettext_reader) objects
    226205 * @uses apply_filters() Calls 'ngettext' hook on domains text returned,
    227206 *              along with $single, $plural, and $number parameters. Expected to return string.
     
    252231}
    253232
    254233/**
    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 /**
    265234 * Register plural strings in POT file, but don't translate them.
    266235 *
    267236 * Used when you want do keep structures with translatable plural strings and
     
    276245 *  $message = $messages[$type];
    277246 *  $usable_text = sprintf(_n($message[0], $message[1], $count), $count);
    278247 *
    279  * @since 2.5
     248 * @since 2.8.0
    280249 * @param $single Single form to be i18ned
    281250 * @param $plural Plural form to be i18ned
    282251 * @return array array($single, $plural)
  • 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/formatting.php

     
    22652265}
    22662266
    22672267/**
    2268  * Performs esc_url() for database or redirect usage.
    2269  *
    2270  * @see esc_url()
    2271  * @deprecated 2.8.0
    2272  *
    2273  * @since 2.3.1
    2274  *
    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 /**
    22842268 * Convert entities, while preserving already-encoded entities.
    22852269 *
    22862270 * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes.
     
    23182302}
    23192303
    23202304/**
    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.4
    2326  *
    2327  * @deprecated 2.8.0
    2328  * @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 /**
    23382305 * Escaping for HTML blocks.
    23392306 *
    23402307 * @since 2.8.0
     
    23492316}
    23502317
    23512318/**
    2352  * Escaping for HTML blocks
    2353  * @deprecated 2.8.0
    2354  * @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 args
    2358                 $args = func_get_args();
    2359                 return call_user_func_array( '_wp_specialchars', $args );
    2360         } else {
    2361                 return esc_html( $string );
    2362         }
    2363 }
    2364 
    2365 /**
    23662319 * Escaping for HTML attributes.
    23672320 *
    23682321 * @since 2.8.0
     
    23772330}
    23782331
    23792332/**
    2380  * Escaping for HTML attributes.
    2381  *
    2382  * @since 2.0.6
    2383  *
    2384  * @deprecated 2.8.0
    2385  * @see esc_attr()
    2386  *
    2387  * @param string $text
    2388  * @return string
    2389  */
    2390 function attribute_escape( $text ) {
    2391         return esc_attr( $text );
    2392 }
    2393 
    2394 /**
    23952333 * Escape a HTML tag name.
    23962334 *
    23972335 * @since 2.5.0
  • 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' );
    1883         return translate_with_context( $text, $domain );
     2005        _deprecated_function( __FUNCTION__, '2.9', '_x()' );
     2006  return before_last_bar( translate( $text, $domain ) );
    18842007}
    18852008
    18862009/**
     
    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 * 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 */
     2040function 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 */
     2060function 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 */
     2089function 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 */
     2134function 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 */
     2191function 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 */
     2219function 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 */
     2237function 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 */
     2253function 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 */
     2271function 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

     
    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-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
     
    580560 * {@internal Missing Short Description}}
    581561 *
    582562 * @since unknown
    583  * @deprecated Use {@link wp_link_category_checklist()}
    584  * @see wp_link_category_checklist()
    585563 *
    586  * @param unknown_type $default
    587  */
    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 unknown
    598  *
    599564 * @param unknown_type $link_id
    600565 */
    601566function wp_link_category_checklist( $link_id = 0 ) {
     
    24022367 *
    24032368 * @since unknown
    24042369 *
    2405  * @param unknown_type $currentcat
    2406  * @param unknown_type $currentparent
    2407  * @param unknown_type $parent
    2408  * @param unknown_type $level
    2409  * @param unknown_type $categories
    2410  * @return unknown
    2411  */
    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( '&#8211; ', $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 unknown
    2437  *
    24382370 * @param unknown_type $meta
    24392371 */
    24402372function list_meta( $meta ) {