Changeset 6514
- Timestamp:
- 12/28/2007 09:17:42 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r6370 r6514 87 87 */ 88 88 function get_postdata($postid) { 89 _deprecated_function(__FUNCTION__, '0.0', 'get_post()'); 90 89 91 $post = &get_post($postid); 90 92 … … 119 121 global $wp_query, $post; 120 122 123 _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') ); 124 121 125 // Since the old style loop is being used, advance the query iterator here. 122 126 $wp_query->next_post(); … … 136 140 */ 137 141 function the_category_ID($echo = true) { 142 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()'); 143 138 144 // Grab the first cat in the list. 139 145 $categories = get_the_category(); … … 158 164 function the_category_head($before='', $after='') { 159 165 global $currentcat, $previouscat; 166 167 _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()'); 168 160 169 // Grab the first cat in the list. 161 170 $categories = get_the_category(); … … 185 194 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { 186 195 196 _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()'); 197 187 198 if ( empty($in_same_cat) || 'no' == $in_same_cat ) 188 199 $in_same_cat = false; … … 218 229 */ 219 230 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 231 _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()'); 220 232 221 233 if ( empty($in_same_cat) || 'no' == $in_same_cat ) … … 250 262 */ 251 263 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { 264 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 265 252 266 $author_data = get_userdata($user_id); 253 267 return ($author_data->user_level > 1); … … 267 281 */ 268 282 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { 283 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 284 269 285 $author_data = get_userdata($user_id); 270 286 return ($author_data->user_level >= 1); … … 284 300 */ 285 301 function user_can_edit_post($user_id, $post_id, $blog_id = 1) { 302 _deprecated_function(__FUNCTION__, '0', 'current_user_can()'); 303 286 304 $author_data = get_userdata($user_id); 287 305 $post = get_post($post_id); … … 310 328 */ 311 329 function user_can_delete_post($user_id, $post_id, $blog_id = 1) { 330 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 331 312 332 // right now if one can edit, one can delete 313 333 return user_can_edit_post($user_id, $post_id, $blog_id); … … 327 347 */ 328 348 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { 349 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 350 329 351 $author_data = get_userdata($user_id); 330 352 return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); … … 345 367 */ 346 368 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { 369 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 370 347 371 $author_data = get_userdata($user_id); 348 372 return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); … … 363 387 */ 364 388 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { 389 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 390 365 391 // right now if one can edit a post, one can edit comments made on it 366 392 return user_can_edit_post($user_id, $post_id, $blog_id); … … 381 407 */ 382 408 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { 409 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 410 383 411 // right now if one can edit comments, one can delete comments 384 412 return user_can_edit_post_comments($user_id, $post_id, $blog_id); … … 397 425 */ 398 426 function user_can_edit_user($user_id, $other_user) { 427 _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); 428 399 429 $user = get_userdata($user_id); 400 430 $other = get_userdata($other_user); … … 428 458 $show_description = true, $show_rating = false, 429 459 $limit = -1, $show_updated = 0) { 460 _deprecated_function(__FUNCTION__, '0.0', 'get_links()'); 461 430 462 $cat_id = -1; 431 463 $cat = get_term_by('name', $cat_name, 'link_category'); … … 448 480 */ 449 481 function wp_get_linksbyname($category, $args = '') { 482 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); 483 450 484 $cat = get_term_by('name', $category, 'link_category'); 451 485 if ( !$cat ) … … 479 513 */ 480 514 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { 515 _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()'); 516 481 517 $cat_id = -1; 482 518 $cat = get_term_by('name', $cat_name, 'link_category'); … … 530 566 */ 531 567 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { 568 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); 569 532 570 $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); 533 571 … … 561 599 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ", 562 600 $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { 601 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); 563 602 564 603 get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); … … 587 626 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, 588 627 $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { 628 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); 589 629 590 630 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); … … 601 641 */ 602 642 function get_autotoggle($id = 0) { 643 _deprecated_function(__FUNCTION__, '0.0' ); 603 644 return 0; 604 645 } … … 632 673 $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, 633 674 $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { 675 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); 676 634 677 $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 635 678 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); … … 646 689 */ 647 690 function wp_list_cats($args = '') { 691 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); 692 648 693 $r = wp_parse_args( $args ); 649 694 … … 686 731 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, 687 732 $selected = 0, $exclude = 0) { 733 _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()'); 688 734 689 735 $show_option_all = ''; … … 708 754 */ 709 755 function tinymce_include() { 756 _deprecated_function(__FUNCTION__, '0.0', 'wp_print_scripts()/WP_Scripts'); 757 710 758 wp_print_script('wp_tiny_mce'); 711 759 } … … 725 773 */ 726 774 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { 775 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()'); 776 727 777 $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); 728 778 return wp_list_authors($args); … … 739 789 */ 740 790 function wp_get_post_cats($blogid = '1', $post_ID = 0) { 791 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()'); 741 792 return wp_get_post_categories($post_ID); 742 793 } … … 755 806 */ 756 807 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 808 _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()'); 757 809 return wp_set_post_categories($post_ID, $post_categories); 758 810 } … … 772 824 */ 773 825 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 826 _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()'); 774 827 $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); 775 828 return wp_get_archives($args); … … 789 842 */ 790 843 function get_author_link($echo = false, $author_id, $author_nicename = '') { 844 _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()'); 845 791 846 $link = get_author_posts_url($author_id, $author_nicename); 792 847 … … 814 869 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', 815 870 $pagelink='%', $more_file='') { 871 _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()'); 872 816 873 $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); 817 874 return wp_link_pages($args); … … 829 886 */ 830 887 function get_settings($option) { 888 _deprecated_function(__FUNCTION__, '0.0', 'get_option()'); 889 831 890 return get_option($option); 832 891 } … … 840 899 */ 841 900 function permalink_link() { 901 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()'); 842 902 the_permalink(); 843 903 } … … 853 913 */ 854 914 function permalink_single_rss($file = '') { 915 _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); 855 916 the_permalink_rss(); 856 917 } … … 868 929 */ 869 930 function wp_get_links($args = '') { 931 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); 932 870 933 if ( strpos( $args, '=' ) === false ) { 871 934 $cat_id = $args; … … 914 977 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name', 915 978 $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { 979 _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); 916 980 917 981 $order = 'ASC'; … … 1008 1072 */ 1009 1073 function get_links_list($order = 'name', $deprecated = '') { 1074 _deprecated_function(__FUNCTION__, '0.0', 'get_categories()'); 1075 1010 1076 $order = strtolower($order); 1011 1077 … … 1054 1120 */ 1055 1121 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { 1122 _deprecated_function(__FUNCTION__, '0.0' ); 1123 1056 1124 if ( $count ) 1057 1125 $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); … … 1076 1144 */ 1077 1145 function get_linkrating($link) { 1146 _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()'); 1078 1147 return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); 1079 1148 } … … 1090 1159 */ 1091 1160 function get_linkcatname($id = 0) { 1161 _deprecated_function(__FUNCTION__, '0.0', 'get_category()'); 1162 1092 1163 $id = (int) $id; 1093 1164 … … 1117 1188 */ 1118 1189 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { 1190 _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()'); 1119 1191 post_comments_feed_link($link_text); 1120 1192 } … … 1133 1205 */ 1134 1206 function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { 1207 _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); 1208 1135 1209 $link = get_category_feed_link($cat_ID, $feed = 'rss2'); 1136 1210 … … 1153 1227 */ 1154 1228 function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { 1229 _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()'); 1230 1155 1231 $link = get_author_feed_link($author_id); 1156 1232 if ( $echo ) -
trunk/wp-includes/functions.php
r6447 r6514 1606 1606 } 1607 1607 1608 /** 1609 * _deprecated_function() - Marks a function as deprecated and informs when it has been used. 1610 * 1611 * There is a hook deprecated_function_run that will be called that can be used to get the backtrace 1612 * up to what file and function called the deprecated function. 1613 * 1614 * The current behavior is to trigger an user error if WP_DEBUG is defined and is true. 1615 * 1616 * This function is to be used in every function in depreceated.php 1617 * 1618 * @package WordPress 1619 * @package Debug 1620 * @since 2.4 1621 * @access private 1622 * 1623 * @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead. 1624 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. 1625 * 1626 * @param string $function The function that was called 1627 * @param string $version The version of WordPress that depreceated the function 1628 * @param string $replacement Optional. The function that should have been called 1629 */ 1630 function _deprecated_function($function, $version, $replacement=null) { 1631 1632 do_action('deprecated_function_run', $function, $replacement); 1633 1634 // Allow plugin to filter the output error trigger 1635 if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_function_trigger_error', true )) { 1636 if( !is_null($replacement) ) 1637 trigger_error( printf( __("%s is <strong>deprecated</strong> since version %s! Use %s instead."), $function, $version, $replacement ) ); 1638 else 1639 trigger_error( printf( __("%s is <strong>deprecated</strong since version %s with no alternative available."), $function, $version ) ); 1640 } 1641 } 1642 1643 /** 1644 * _deprecated_file() - Marks a file as deprecated and informs when it has been used. 1645 * 1646 * There is a hook deprecated_file_included that will be called that can be used to get the backtrace 1647 * up to what file and function included the deprecated file. 1648 * 1649 * The current behavior is to trigger an user error if WP_DEBUG is defined and is true. 1650 * 1651 * This function is to be used in every file that is depreceated 1652 * 1653 * @package WordPress 1654 * @package Debug 1655 * @since 2.4 1656 * @access private 1657 * 1658 * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead. 1659 * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. 1660 * 1661 * @param string $file The file that was included 1662 * @param string $version The version of WordPress that depreceated the function 1663 * @param string $replacement Optional. The function that should have been called 1664 */ 1665 function _deprecated_file($file, $version, $replacement=null) { 1666 1667 do_action('deprecated_file_included', $file, $replacement); 1668 1669 // Allow plugin to filter the output error trigger 1670 if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) { 1671 if( !is_null($replacement) ) 1672 trigger_error( printf( __("%s is <strong>deprecated</strong> since version %s! Use %s instead."), $file, $version, $replacement ) ); 1673 else 1674 trigger_error( printf( __("%s is <strong>deprecated</strong since version %s with no alternative available."), $file, $version ) ); 1675 } 1676 } 1608 1677 ?> -
trunk/wp-includes/registration-functions.php
r5390 r6514 1 1 <?php 2 2 // Deprecated. Use registration.php. 3 _deprecated_file( basename(__FILE__), '0.0', 'registration.php' ); 3 4 require_once(ABSPATH . WPINC . '/registration.php'); 4 5 ?> -
trunk/wp-includes/rss-functions.php
r5390 r6514 1 1 <?php 2 2 // Deprecated. Use rss.php instead. 3 4 _deprecated_file( basename(__FILE__), '0.0', 'rss.php' ); 3 5 require_once (ABSPATH . WPINC . '/rss.php'); 4 6 ?> -
trunk/wp-settings.php
r6447 r6514 157 157 error_reporting(E_ALL); 158 158 } else { 159 error_reporting(E_ALL ^ E_NOTICE );159 error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE); 160 160 } 161 161
Note: See TracChangeset
for help on using the changeset viewer.