Changeset 6370
- Timestamp:
- 12/10/2007 06:52:24 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/deprecated.php
r6365 r6370 1 1 <?php 2 /** 3 * Deprecated functions from past WordPress versions 4 * @package WordPress 5 * @subpackage Deprecated 6 */ 2 7 3 8 /* … … 5 10 */ 6 11 12 /** 13 * The name of the Posts table 14 * @global string $tableposts 15 * @deprecated Use $wpdb->posts 16 */ 7 17 $tableposts = $wpdb->posts; 18 19 /** 20 * The name of the Users table 21 * @global string $tableusers 22 * @deprecated Use $wpdb->users 23 */ 8 24 $tableusers = $wpdb->users; 25 26 /** 27 * The name of the Categories table 28 * @global string $tablecategories 29 * @deprecated Use $wpdb->categories 30 */ 9 31 $tablecategories = $wpdb->categories; 32 33 /** 34 * The name of the post to category table 35 * @global string $tablepost2cat 36 * @deprecated Use $wpdb->post2cat; 37 */ 10 38 $tablepost2cat = $wpdb->post2cat; 39 40 /** 41 * The name of the comments table 42 * @global string $tablecomments 43 * @deprecated Use $wpdb->comments; 44 */ 11 45 $tablecomments = $wpdb->comments; 46 47 /** 48 * The name of the links table 49 * @global string $tablelinks 50 * @deprecated Use $wpdb->links; 51 */ 12 52 $tablelinks = $wpdb->links; 53 54 /** 55 * @global string $tablelinkcategories 56 * @deprecated Not used anymore; 57 */ 13 58 $tablelinkcategories = 'linkcategories_is_gone'; 59 60 /** 61 * The name of the options table 62 * @global string $tableoptions 63 * @deprecated Use $wpdb->options; 64 */ 14 65 $tableoptions = $wpdb->options; 66 67 /** 68 * The name of the postmeta table 69 * @global string $tablepostmeta 70 * @deprecated Use $wpdb->postmeta; 71 */ 15 72 $tablepostmeta = $wpdb->postmeta; 16 73 … … 19 76 */ 20 77 21 // Use get_post(). 78 /** 79 * get_postdata() - Entire Post data 80 * 81 * @since 0.71 82 * @deprecated Use get_post() 83 * @see get_post() 84 * 85 * @param int $postid 86 * @return array 87 */ 22 88 function get_postdata($postid) { 23 89 $post = &get_post($postid); … … 44 110 } 45 111 46 // Use the new post loop. 112 /** 113 * start_wp() - Sets up the WordPress Loop 114 * 115 * @since 1.0.1 116 * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} 117 */ 47 118 function start_wp() { 48 119 global $wp_query, $post; … … 54 125 } 55 126 127 /** 128 * the_category_ID() - Return or Print Category ID 129 * 130 * @since 0.71 131 * @deprecated use get_the_category() 132 * @see get_the_category() 133 * 134 * @param bool $echo 135 * @return null|int 136 */ 56 137 function the_category_ID($echo = true) { 57 138 // Grab the first cat in the list. … … 65 146 } 66 147 148 /** 149 * the_category_head() - Print category with optional text before and after 150 * 151 * @since 0.71 152 * @deprecated use get_the_category_by_ID() 153 * @see get_the_category_by_ID() 154 * 155 * @param string $before 156 * @param string $after 157 */ 67 158 function the_category_head($before='', $after='') { 68 159 global $currentcat, $previouscat; … … 78 169 } 79 170 80 // Use previous_post_link(). 171 /** 172 * previous_post() - Prints link to the previous post 173 * 174 * @since 1.5 175 * @deprecated Use previous_post_link() 176 * @see previous_post_link() 177 * 178 * @param string $format 179 * @param string $previous 180 * @param string $title 181 * @param string $in_same_cat 182 * @param int $limitprev 183 * @param string $excluded_categories 184 */ 81 185 function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { 82 186 … … 99 203 } 100 204 101 // Use next_post_link(). 205 /** 206 * next_post() - Prints link to the next post 207 * 208 * @since 0.71 209 * @deprecated Use next_post_link() 210 * @see next_post_link() 211 * 212 * @param string $format 213 * @param string $previous 214 * @param string $title 215 * @param string $in_same_cat 216 * @param int $limitprev 217 * @param string $excluded_categories 218 */ 102 219 function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 103 220 … … 120 237 } 121 238 122 // 123 // Use current_user_can() for these. 124 // 125 126 /* returns true if $user_id can create a new post */ 239 /** 240 * user_can_create_post() - Whether user can create a post 241 * 242 * @since 1.5 243 * @deprecated Use current_user_can() 244 * @see current_user_can() 245 * 246 * @param int $user_id 247 * @param int $blog_id Not Used 248 * @param int $category_id Not Used 249 * @return bool 250 */ 127 251 function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { 128 252 $author_data = get_userdata($user_id); … … 130 254 } 131 255 132 /* returns true if $user_id can create a new post */ 256 /** 257 * user_can_create_draft() - Whether user can create a post 258 * 259 * @since 1.5 260 * @deprecated Use current_user_can() 261 * @see current_user_can() 262 * 263 * @param int $user_id 264 * @param int $blog_id Not Used 265 * @param int $category_id Not Used 266 * @return bool 267 */ 133 268 function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { 134 269 $author_data = get_userdata($user_id); … … 136 271 } 137 272 138 /* returns true if $user_id can edit $post_id */ 273 /** 274 * user_can_edit_post() - Whether user can edit a post 275 * 276 * @since 1.5 277 * @deprecated Use current_user_can() 278 * @see current_user_can() 279 * 280 * @param int $user_id 281 * @param int $post_id 282 * @param int $blog_id Not Used 283 * @return bool 284 */ 139 285 function user_can_edit_post($user_id, $post_id, $blog_id = 1) { 140 286 $author_data = get_userdata($user_id); … … 151 297 } 152 298 153 /* returns true if $user_id can delete $post_id */ 299 /** 300 * user_can_delete_post() - Whether user can delete a post 301 * 302 * @since 1.5 303 * @deprecated Use current_user_can() 304 * @see current_user_can() 305 * 306 * @param int $user_id 307 * @param int $post_id 308 * @param int $blog_id Not Used 309 * @return bool 310 */ 154 311 function user_can_delete_post($user_id, $post_id, $blog_id = 1) { 155 312 // right now if one can edit, one can delete … … 157 314 } 158 315 159 /* returns true if $user_id can set new posts' dates on $blog_id */ 316 /** 317 * user_can_set_post_date() - Whether user can set new posts' dates 318 * 319 * @since 1.5 320 * @deprecated Use current_user_can() 321 * @see current_user_can() 322 * 323 * @param int $user_id 324 * @param int $blog_id Not Used 325 * @param int $category_id Not Used 326 * @return bool 327 */ 160 328 function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { 161 329 $author_data = get_userdata($user_id); … … 164 332 165 333 /* returns true if $user_id can edit $post_id's date */ 334 /** 335 * user_can_edit_post_date() - Whether user can delete a post 336 * 337 * @since 1.5 338 * @deprecated Use current_user_can() 339 * @see current_user_can() 340 * 341 * @param int $user_id 342 * @param int $post_id 343 * @param int $blog_id Not Used 344 * @return bool 345 */ 166 346 function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { 167 347 $author_data = get_userdata($user_id); … … 170 350 171 351 /* returns true if $user_id can edit $post_id's comments */ 352 /** 353 * user_can_edit_post_comments() - Whether user can delete a post 354 * 355 * @since 1.5 356 * @deprecated Use current_user_can() 357 * @see current_user_can() 358 * 359 * @param int $user_id 360 * @param int $post_id 361 * @param int $blog_id Not Used 362 * @return bool 363 */ 172 364 function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { 173 365 // right now if one can edit a post, one can edit comments made on it … … 176 368 177 369 /* returns true if $user_id can delete $post_id's comments */ 370 /** 371 * user_can_delete_post_comments() - Whether user can delete a post 372 * 373 * @since 1.5 374 * @deprecated Use current_user_can() 375 * @see current_user_can() 376 * 377 * @param int $user_id 378 * @param int $post_id 379 * @param int $blog_id Not Used 380 * @return bool 381 */ 178 382 function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { 179 383 // right now if one can edit comments, one can delete comments … … 181 385 } 182 386 387 /** 388 * user_can_edit_user() - Can user can edit other user 389 * 390 * @since 1.5 391 * @deprecated Use current_user_can() 392 * @see current_user_can() 393 * 394 * @param int $user_id 395 * @param int $other_user 396 * @return bool 397 */ 183 398 function user_can_edit_user($user_id, $other_user) { 184 399 $user = get_userdata($user_id); … … 190 405 } 191 406 192 /** function get_linksbyname() 193 ** Gets the links associated with category 'cat_name'. 194 ** Parameters: 195 ** cat_name (default 'noname') - The category name to use. If no 196 ** match is found uses all 197 ** before (default '') - the html to output before the link 198 ** after (default '<br />') - the html to output after the link 199 ** between (default ' ') - the html to output between the link/image 200 ** and it's description. Not used if no image or show_images == true 201 ** show_images (default true) - whether to show images (if defined). 202 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 203 ** 'url', 'description' or 'rating'. Or maybe owner. If you start the 204 ** name with an underscore the order will be reversed. 205 ** You can also specify 'rand' as the order which will return links in a 206 ** random order. 207 ** show_description (default true) - whether to show the description if 208 ** show_images=false/not defined 209 ** show_rating (default false) - show rating stars/chars 210 ** limit (default -1) - Limit to X entries. If not specified, all entries 211 ** are shown. 212 ** show_updated (default 0) - whether to show last updated timestamp 213 */ 214 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', 215 $between = " ", $show_images = true, $orderby = 'id', 216 $show_description = true, $show_rating = false, 217 $limit = -1, $show_updated = 0) { 218 global $wpdb; 219 $cat_id = -1; 220 $cat = get_term_by('name', $cat_name, 'link_category'); 221 if ( $cat ) 222 $cat_id = $cat->term_id; 223 224 get_links($cat_id, $before, $after, $between, $show_images, $orderby, 225 $show_description, $show_rating, $limit, $show_updated); 226 } 227 228 /** function wp_get_linksbyname() 229 ** Gets the links associated with the named category. 230 ** Parameters: 231 ** category (no default) - The category to use. 232 **/ 407 /** 408 * get_linksbyname() - Gets the links associated with category $cat_name. 409 * 410 * @since 0.71 411 * @deprecated Use get_links() 412 * @see get_links() 413 * 414 * @param string $cat_name Optional. The category name to use. If no match is found uses all. 415 * @param string $before Optional. The html to output before the link. 416 * @param string $after Optional. The html to output after the link. 417 * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true. 418 * @param bool $show_images Optional. Whether to show images (if defined). 419 * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner. 420 * If you start the name with an underscore the order will be reversed. You can also specify 'rand' as the order which will return links in a 421 * random order. 422 * @param bool $show_description Optional. Whether to show the description if show_images=false/not defined. 423 * @param bool $show_rating Optional. Show rating stars/chars. 424 * @param int $limit Optional. Limit to X entries. If not specified, all entries are shown. 425 * @param int $show_updated Optional. Whether to show last updated timestamp 426 */ 427 function get_linksbyname($cat_name = "noname", $before = '', $after = '<br />', $between = " ", $show_images = true, $orderby = 'id', 428 $show_description = true, $show_rating = false, 429 $limit = -1, $show_updated = 0) { 430 $cat_id = -1; 431 $cat = get_term_by('name', $cat_name, 'link_category'); 432 if ( $cat ) 433 $cat_id = $cat->term_id; 434 435 get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated); 436 } 437 438 /** 439 * wp_get_linksbyname() - Gets the links associated with the named category. 440 * 441 * @since 1.0.1 442 * @deprecated Use wp_get_links() 443 * @see wp_get_links() 444 * 445 * @param string $category The category to use. 446 * @param string $args 447 * @return bool|null 448 */ 233 449 function wp_get_linksbyname($category, $args = '') { 234 global $wpdb; 235 236 $cat = get_term_by('name', $cat_name, 'link_category'); 450 $cat = get_term_by('name', $category, 'link_category'); 237 451 if ( !$cat ) 238 452 return false; … … 243 457 } 244 458 245 /** function get_linkobjectsbyname() 246 ** Gets an array of link objects associated with category 'cat_name'. 247 ** Parameters: 248 ** cat_name (default 'noname') - The category name to use. If no 249 ** match is found uses all 250 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 251 ** 'url', 'description', or 'rating'. Or maybe owner. If you start the 252 ** name with an underscore the order will be reversed. 253 ** You can also specify 'rand' as the order which will return links in a 254 ** random order. 255 ** limit (default -1) - Limit to X entries. If not specified, all entries 256 ** are shown. 257 ** 258 ** Use this like: 259 ** $links = get_linkobjectsbyname('fred'); 260 ** foreach ($links as $link) { 261 ** echo '<li>'.$link->link_name.'</li>'; 262 ** } 263 **/ 459 /** 460 * get_linkobjectsbyname() - Gets an array of link objects associated with category $cat_name. 461 * 462 * <code> 463 * $links = get_linkobjectsbyname('fred'); 464 * foreach ($links as $link) { 465 * echo '<li>'.$link->link_name.'</li>'; 466 * } 467 * </code> 468 * 469 * @since 1.0.1 470 * @deprecated Use get_linkobjects() 471 * @see get_linkobjects() 472 * 473 * @param string $cat_name The category name to use. If no match is found uses all. 474 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. 475 * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also 476 * specify 'rand' as the order which will return links in a random order. 477 * @param int $limit Limit to X entries. If not specified, all entries are shown. 478 * @return unknown 479 */ 264 480 function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { 265 global $wpdb; 266 $cat_id = -1; 267 $cat = get_term_by('name', $cat_name, 'link_category'); 268 if ( $cat ) 269 $cat_id = $cat->term_id; 270 271 return get_linkobjects($cat_id, $orderby, $limit); 272 } 273 274 /** function get_linkobjects() 275 ** Gets an array of link objects associated with category n. 276 ** Parameters: 277 ** category (default -1) - The category to use. If no category supplied 278 ** uses all 279 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 280 ** 'url', 'description', or 'rating'. Or maybe owner. If you start the 281 ** name with an underscore the order will be reversed. 282 ** You can also specify 'rand' as the order which will return links in a 283 ** random order. 284 ** limit (default -1) - Limit to X entries. If not specified, all entries 285 ** are shown. 286 ** 287 ** Use this like: 288 ** $links = get_linkobjects(1); 289 ** if ($links) { 290 ** foreach ($links as $link) { 291 ** echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>'; 292 ** } 293 ** } 294 ** Fields are: 295 ** link_id 296 ** link_url 297 ** link_name 298 ** link_image 299 ** link_target 300 ** link_category 301 ** link_description 302 ** link_visible 303 ** link_owner 304 ** link_rating 305 ** link_updated 306 ** link_rel 307 ** link_notes 308 **/ 309 // Deprecate in favor of get_linkz(). 481 $cat_id = -1; 482 $cat = get_term_by('name', $cat_name, 'link_category'); 483 if ( $cat ) 484 $cat_id = $cat->term_id; 485 486 return get_linkobjects($cat_id, $orderby, $limit); 487 } 488 489 /** 490 * get_linkobjects() - Gets an array of link objects associated with category n. 491 * 492 * Usage: 493 * <code> 494 * $links = get_linkobjects(1); 495 * if ($links) { 496 * foreach ($links as $link) { 497 * echo '<li>'.$link->link_name.'<br />'.$link->link_description.'</li>'; 498 * } 499 * } 500 * </code> 501 * 502 * Fields are: 503 * <ol> 504 * <li>link_id</li> 505 * <li>link_url</li> 506 * <li>link_name</li> 507 * <li>link_image</li> 508 * <li>link_target</li> 509 * <li>link_category</li> 510 * <li>link_description</li> 511 * <li>link_visible</li> 512 * <li>link_owner</li> 513 * <li>link_rating</li> 514 * <li>link_updated</li> 515 * <li>link_rel</li> 516 * <li>link_notes</li> 517 * </ol> 518 * 519 * @since 1.0.1 520 * @deprecated Use get_bookmarks() 521 * @see get_bookmarks() 522 * 523 * @param int $category The category to use. If no category supplied uses all 524 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', 525 * 'description', or 'rating'. Or maybe owner. If you start the name with an 526 * underscore the order will be reversed. You can also specify 'rand' as the 527 * order which will return links in a random order. 528 * @param int $limit Limit to X entries. If not specified, all entries are shown. 529 * @return unknown 530 */ 310 531 function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { 311 global $wpdb; 312 313 $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); 314 315 $links_array = array(); 316 foreach ($links as $link) { 317 $links_array[] = $link; 318 } 319 320 return $links_array; 321 } 322 323 /** function get_linksbyname_withrating() 324 ** Gets the links associated with category 'cat_name' and display rating stars/chars. 325 ** Parameters: 326 ** cat_name (default 'noname') - The category name to use. If no 327 ** match is found uses all 328 ** before (default '') - the html to output before the link 329 ** after (default '<br />') - the html to output after the link 330 ** between (default ' ') - the html to output between the link/image 331 ** and it's description. Not used if no image or show_images == true 332 ** show_images (default true) - whether to show images (if defined). 333 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 334 ** 'url' or 'description'. Or maybe owner. If you start the 335 ** name with an underscore the order will be reversed. 336 ** You can also specify 'rand' as the order which will return links in a 337 ** random order. 338 ** show_description (default true) - whether to show the description if 339 ** show_images=false/not defined 340 ** limit (default -1) - Limit to X entries. If not specified, all entries 341 ** are shown. 342 ** show_updated (default 0) - whether to show last updated timestamp 343 */ 344 function get_linksbyname_withrating($cat_name = "noname", $before = '', 345 $after = '<br />', $between = " ", 346 $show_images = true, $orderby = 'id', 347 $show_description = true, $limit = -1, $show_updated = 0) { 348 349 get_linksbyname($cat_name, $before, $after, $between, $show_images, 350 $orderby, $show_description, true, $limit, $show_updated); 351 } 352 353 /** function get_links_withrating() 354 ** Gets the links associated with category n and display rating stars/chars. 355 ** Parameters: 356 ** category (default -1) - The category to use. If no category supplied 357 ** uses all 358 ** before (default '') - the html to output before the link 359 ** after (default '<br />') - the html to output after the link 360 ** between (default ' ') - the html to output between the link/image 361 ** and it's description. Not used if no image or show_images == true 362 ** show_images (default true) - whether to show images (if defined). 363 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 364 ** 'url' or 'description'. Or maybe owner. If you start the 365 ** name with an underscore the order will be reversed. 366 ** You can also specify 'rand' as the order which will return links in a 367 ** random order. 368 ** show_description (default true) - whether to show the description if 369 ** show_images=false/not defined . 370 ** limit (default -1) - Limit to X entries. If not specified, all entries 371 ** are shown. 372 ** show_updated (default 0) - whether to show last updated timestamp 373 */ 374 function get_links_withrating($category = -1, $before = '', $after = '<br />', 375 $between = " ", $show_images = true, 376 $orderby = 'id', $show_description = true, 377 $limit = -1, $show_updated = 0) { 378 379 get_links($category, $before, $after, $between, $show_images, $orderby, 380 $show_description, true, $limit, $show_updated); 381 } 382 383 /** function get_get_autotoggle() 384 ** Gets the auto_toggle setting of category n. 385 ** Parameters: id (default 0) - The category to get. If no category supplied 386 ** uses 0 532 $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); 533 534 $links_array = array(); 535 foreach ($links as $link) 536 $links_array[] = $link; 537 538 return $links_array; 539 } 540 541 /** 542 * get_linksbyname_withrating() - Gets the links associated with category 'cat_name' and display rating stars/chars. 543 * 544 * @since 0.71 545 * @deprecated Use get_bookmarks() 546 * @see get_bookmarks() 547 * 548 * @param string $cat_name The category name to use. If no match is found uses all 549 * @param string $before The html to output before the link 550 * @param string $after The html to output after the link 551 * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images is true 552 * @param bool $show_images Whether to show images (if defined). 553 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', 554 * 'description', or 'rating'. Or maybe owner. If you start the name with an 555 * underscore the order will be reversed. You can also specify 'rand' as the 556 * order which will return links in a random order. 557 * @param bool $show_description Whether to show the description if show_images=false/not defined 558 * @param int $limit Limit to X entries. If not specified, all entries are shown. 559 * @param int $show_updated Whether to show last updated timestamp 560 */ 561 function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '<br />', $between = " ", 562 $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { 563 564 get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); 565 } 566 567 /** 568 * get_links_withrating() - Gets the links associated with category n and display rating stars/chars. 569 * 570 * @since 0.71 571 * @deprecated Use get_bookmarks() 572 * @see get_bookmarks() 573 * 574 * @param int $category The category to use. If no category supplied uses all 575 * @param string $before The html to output before the link 576 * @param string $after The html to output after the link 577 * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true 578 * @param bool $show_images Whether to show images (if defined). 579 * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 580 * 'description', or 'rating'. Or maybe owner. If you start the name with an 581 * underscore the order will be reversed. You can also specify 'rand' as the 582 * order which will return links in a random order. 583 * @param bool $show_description Whether to show the description if show_images=false/not defined. 584 * @param string $limit Limit to X entries. If not specified, all entries are shown. 585 * @param int $show_updated Whether to show last updated timestamp 586 */ 587 function get_links_withrating($category = -1, $before = '', $after = '<br />', $between = " ", $show_images = true, 588 $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { 589 590 get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); 591 } 592 593 /** 594 * get_autotoggle() - Gets the auto_toggle setting 595 * 596 * @since 0.71 597 * @deprecated No alternative function available 598 * 599 * @param int $id The category to get. If no category supplied uses 0 600 * @return int Only returns 0. 387 601 */ 388 602 function get_autotoggle($id = 0) { … … 390 604 } 391 605 392 // Use wp_list_cats(). 393 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) { 606 /** 607 * @since 0.71 608 * @deprecated Use wp_list_categories() 609 * @see wp_list_categories() 610 * 611 * @param int $optionall 612 * @param string $all 613 * @param string $sort_column 614 * @param string $sort_order 615 * @param string $file 616 * @param bool $list 617 * @param int $optiondates 618 * @param int $optioncount 619 * @param int $hide_empty 620 * @param int $use_desc_for_title 621 * @param bool $children 622 * @param int $child_of 623 * @param int $categories 624 * @param int $recurse 625 * @param string $feed 626 * @param string $feed_image 627 * @param string $exclude 628 * @param bool $hierarchical 629 * @return unknown 630 */ 631 function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, 632 $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, 633 $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { 394 634 $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 395 635 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); … … 397 637 } 398 638 639 /** 640 * @since 1.2 641 * @deprecated Use wp_list_categories() 642 * @see wp_list_categories() 643 * 644 * @param string|array $args 645 * @return unknown 646 */ 399 647 function wp_list_cats($args = '') { 400 648 $r = wp_parse_args( $args ); … … 418 666 } 419 667 668 /** 669 * @since 0.71 670 * @deprecated Use wp_dropdown_categories() 671 * @see wp_dropdown_categories() 672 * 673 * @param int $optionall 674 * @param string $all 675 * @param string $orderby 676 * @param string $order 677 * @param int $show_last_update 678 * @param int $show_count 679 * @param int $hide_empty 680 * @param bool $optionnone 681 * @param int $selected 682 * @param int $exclude 683 * @return unknown 684 */ 420 685 function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', 421 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = FALSE,686 $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, 422 687 $selected = 0, $exclude = 0) { 423 688 … … 436 701 } 437 702 438 // Use wp_print_scripts() or WP_Scripts. 703 /** 704 * @since 2.1 705 * @deprecated Use wp_print_scripts() or WP_Scripts. 706 * @see wp_print_scripts() 707 * @see WP_Scripts 708 */ 439 709 function tinymce_include() { 440 710 wp_print_script('wp_tiny_mce'); 441 711 } 442 712 713 /** 714 * @since 1.2 715 * @deprecated Use wp_list_authors() 716 * @see wp_list_authors() 717 * 718 * @param bool $optioncount 719 * @param bool $exclude_admin 720 * @param bool $show_fullname 721 * @param bool $hide_empty 722 * @param string $feed 723 * @param string $feed_image 724 * @return unknown 725 */ 443 726 function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { 444 727 $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); … … 446 729 } 447 730 731 /** 732 * @since 1.0.1 733 * @deprecated Use wp_get_post_categories() 734 * @see wp_get_post_categories() 735 * 736 * @param int $blogid Not Used 737 * @param int $post_ID 738 * @return unknown 739 */ 448 740 function wp_get_post_cats($blogid = '1', $post_ID = 0) { 449 741 return wp_get_post_categories($post_ID); 450 742 } 451 743 744 /** 745 * wp_set_post_cats() - Sets the categories that the post id belongs to. 746 * 747 * @since 1.0.1 748 * @deprecated Use wp_set_post_categories() 749 * @see wp_set_post_categories() 750 * 751 * @param int $blogid Not used 752 * @param int $post_ID 753 * @param array $post_categories 754 * @return unknown 755 */ 452 756 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 453 757 return wp_set_post_categories($post_ID, $post_categories); 454 758 } 455 759 456 // Use wp_get_archives(). 760 /** 761 * @since 0.71 762 * @deprecated Use wp_get_archives() 763 * @see wp_get_archives() 764 * 765 * @param string $type 766 * @param string $limit 767 * @param string $format 768 * @param string $before 769 * @param string $after 770 * @param bool $show_post_count 771 * @return unknown 772 */ 457 773 function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { 458 774 $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); … … 460 776 } 461 777 462 // Use get_author_posts_url(). 778 /** 779 * get_author_link() - Returns or Prints link to the author's posts 780 * 781 * @since 1.2 782 * @deprecated Use get_author_posts_url() 783 * @see get_author_posts_url() 784 * 785 * @param bool $echo Optional. 786 * @param int $author_id Required. 787 * @param string $author_nicename Optional. 788 * @return string|null 789 */ 463 790 function get_author_link($echo = false, $author_id, $author_nicename = '') { 464 791 $link = get_author_posts_url($author_id, $author_nicename); … … 469 796 } 470 797 471 // Use wp_link_pages(). 472 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { 798 /** 799 * link_pages() - Print list of pages based on arguments 800 * 801 * @since 0.71 802 * @deprecated Use wp_link_pages() 803 * @see wp_link_pages() 804 * 805 * @param string $before 806 * @param string $after 807 * @param string $next_or_number 808 * @param string $nextpagelink 809 * @param string $previouspagelink 810 * @param string $pagelink 811 * @param string $more_file 812 * @return string 813 */ 814 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', 815 $pagelink='%', $more_file='') { 473 816 $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); 474 817 return wp_link_pages($args); 475 818 } 476 819 477 // Use get_option(). 820 /** 821 * get_settings() - Get value based on option 822 * 823 * @since 0.71 824 * @deprecated Use get_option() 825 * @see get_option() 826 * 827 * @param string $option 828 * @return string 829 */ 478 830 function get_settings($option) { 479 831 return get_option($option); 480 832 } 481 833 482 // Use the_permalink(). 834 /** 835 * permalink_link() - Print the permalink of the current post in the loop 836 * 837 * @since 0.71 838 * @deprecated Use the_permalink() 839 * @see the_permalink() 840 */ 483 841 function permalink_link() { 484 842 the_permalink(); 485 843 } 486 844 487 // Use the_permalink_rss() 845 /** 846 * permalink_single_rss() - Print the permalink to the RSS feed 847 * 848 * @since 0.71 849 * @deprecated Use the_permalink_rss() 850 * @see the_permalink_rss() 851 * 852 * @param string $file 853 */ 488 854 function permalink_single_rss($file = '') { 489 855 the_permalink_rss(); 490 856 } 491 857 492 /** function wp_get_links() 493 ** Gets the links associated with category n. 494 ** Parameters: 495 ** category (no default) - The category to use. 496 ** or: 497 ** a query string 498 **/ 858 /** 859 * wp_get_links() - Gets the links associated with category. 860 * 861 * @see get_links() for argument information that can be used in $args 862 * @since 1.0.1 863 * @deprecated Use get_bookmarks() 864 * @see get_bookmarks() 865 * 866 * @param string $args a query string 867 * @return null|string 868 */ 499 869 function wp_get_links($args = '') { 500 global $wpdb;501 502 870 if ( strpos( $args, '=' ) === false ) { 503 871 $cat_id = $args; … … 518 886 519 887 return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); 520 } // end wp_get_links 521 522 /** function get_links() 523 ** Gets the links associated with category n. 524 ** Parameters: 525 ** category (default -1) - The category to use. If no category supplied 526 ** uses all 527 ** before (default '') - the html to output before the link 528 ** after (default '<br />') - the html to output after the link 529 ** between (default ' ') - the html to output between the link/image 530 ** and its description. Not used if no image or show_images == true 531 ** show_images (default true) - whether to show images (if defined). 532 ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', 533 ** 'url', 'description', or 'rating'. Or maybe owner. If you start the 534 ** name with an underscore the order will be reversed. 535 ** You can also specify 'rand' as the order which will return links in a 536 ** random order. 537 ** show_description (default true) - whether to show the description if 538 ** show_images=false/not defined . 539 ** show_rating (default false) - show rating stars/chars 540 ** limit (default -1) - Limit to X entries. If not specified, all entries 541 ** are shown. 542 ** show_updated (default 0) - whether to show last updated timestamp 543 ** echo (default true) - whether to echo the results, or return them instead 544 */ 545 function get_links($category = -1, 546 $before = '', 547 $after = '<br />', 548 $between = ' ', 549 $show_images = true, 550 $orderby = 'name', 551 $show_description = true, 552 $show_rating = false, 553 $limit = -1, 554 $show_updated = 1, 555 $echo = true) { 556 557 global $wpdb; 888 } 889 890 /** 891 * get_links() - Gets the links associated with category by id. 892 * 893 * @since 0.71 894 * @deprecated Use get_bookmarks() 895 * @see get_bookmarks() 896 * 897 * @param int $category The category to use. If no category supplied uses all 898 * @param string $before the html to output before the link 899 * @param string $after the html to output after the link 900 * @param string $between the html to output between the link/image and its description. 901 * Not used if no image or show_images == true 902 * @param bool $show_images whether to show images (if defined). 903 * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', 904 * 'description', or 'rating'. Or maybe owner. If you start the name with an 905 * underscore the order will be reversed. You can also specify 'rand' as the order 906 * which will return links in a random order. 907 * @param bool $show_description whether to show the description if show_images=false/not defined. 908 * @param bool $show_rating show rating stars/chars 909 * @param int $limit Limit to X entries. If not specified, all entries are shown. 910 * @param int $show_updated whether to show last updated timestamp 911 * @param bool $echo whether to echo the results, or return them instead 912 * @return null|string 913 */ 914 function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = true, $orderby = 'name', 915 $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { 558 916 559 917 $order = 'ASC'; … … 634 992 } 635 993 636 /* 637 * function get_links_list() 638 * 639 * added by Dougal 994 /** 995 * get_links_list() - Output entire list of links by category 640 996 * 641 997 * Output a list of all links, listed by category, using the … … 643 999 * HTML unordered list. 644 1000 * 645 * Parameters: 646 * order (default 'name') - Sort link categories by 'name' or 'id' 647 * hide_if_empty (default true) - Supress listing empty link categories 648 */ 649 function get_links_list($order = 'name', $hide_if_empty = 'obsolete') { 1001 * @author Dougal 1002 * @since 1.0.1 1003 * @deprecated Use get_categories() 1004 * @see get_categories() 1005 * 1006 * @param string $order Sort link categories by 'name' or 'id' 1007 * @param string $$deprecated Not Used 1008 */ 1009 function get_links_list($order = 'name', $deprecated = '') { 650 1010 $order = strtolower($order); 651 1011 … … 678 1038 } 679 1039 680 681 /** function links_popup_script() 682 ** This function contributed by Fullo -- http://sprite.csr.unibo.it/fullo/ 683 ** Show the link to the links popup and the number of links 684 ** Parameters: 685 ** text (default Links) - the text of the link 686 ** width (default 400) - the width of the popup window 687 ** height (default 400) - the height of the popup window 688 ** file (default linkspopup.php) - the page to open in the popup window 689 ** count (default true) - the number of links in the db 1040 /** 1041 * links_popup_script() - Show the link to the links popup and the number of links 1042 * 1043 * @author Fullo 1044 * @link http://sprite.csr.unibo.it/fullo/ 1045 * 1046 * @since 0.71 1047 * @deprecated {@internal Use function instead is unknown}} 1048 * 1049 * @param string $text the text of the link 1050 * @param int $width the width of the popup window 1051 * @param int $height the height of the popup window 1052 * @param string $file the page to open in the popup window 1053 * @param bool $count the number of links in the db 690 1054 */ 691 1055 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { … … 703 1067 } 704 1068 705 1069 /** 1070 * @since 1.0.1 1071 * @deprecated Use sanitize_bookmark_field() 1072 * @see sanitize_bookmark_field() 1073 * 1074 * @param object $link 1075 * @return unknown 1076 */ 706 1077 function get_linkrating($link) { 707 1078 return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); 708 1079 } 709 1080 710 /** function get_linkcatname() 711 ** Gets the name of category n. 712 ** Parameters: id (default 0) - The category to get. If no category supplied 713 ** uses 0 1081 /** 1082 * get_linkcatname() - Gets the name of category by id. 1083 * 1084 * @since 0.71 1085 * @deprecated Use get_category() 1086 * @see get_category() 1087 * 1088 * @param int $id The category to get. If no category supplied uses 0 1089 * @return string 714 1090 */ 715 1091 function get_linkcatname($id = 0) { … … 730 1106 } 731 1107 732 1108 /** 1109 * comment_rss_link() - Print RSS comment feed link 1110 * 1111 * @since 1.0.1 1112 * @deprecated Use post_comments_feed_link() 1113 * @see post_comments_feed_link() 1114 * 1115 * @param string $link_text 1116 * @param string $deprecated Not used 1117 */ 733 1118 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { 734 1119 post_comments_feed_link($link_text); 735 1120 } 736 1121 737 function get_category_rss_link($echo = false, $cat_ID, $deprecated = '') { 1122 /** 1123 * get_category_rss_link() - Print/Return link to category RSS2 feed 1124 * 1125 * @since 1.2 1126 * @deprecated Use get_category_feed_link() 1127 * @see get_category_feed_link() 1128 * 1129 * @param bool $echo 1130 * @param int $cat_ID 1131 * @param string $deprecated Not used 1132 * @return string|null 1133 */ 1134 function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { 738 1135 $link = get_category_feed_link($cat_ID, $feed = 'rss2'); 739 1136 … … 743 1140 } 744 1141 745 function get_author_rss_link($echo = false, $author_id, $deprecated = '') { 1142 /** 1143 * get_author_rss_link() - Print/Return link to author RSS feed 1144 * 1145 * @since 1.2 1146 * @deprecated Use get_author_feed_link() 1147 * @see get_author_feed_link() 1148 * 1149 * @param bool $echo 1150 * @param int $author_id 1151 * @param string $deprecated Not used 1152 * @return string|null 1153 */ 1154 function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { 746 1155 $link = get_author_feed_link($author_id); 747 1156 if ( $echo )
Note: See TracChangeset
for help on using the changeset viewer.